Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.9
- import QtQuick.Controls 2.5
- import QtQuick.Layouts 1.3
- import 'api' as API
- ApplicationWindow {
- // TODO: Перед релизом привести пути всех
- // изображений в коде к формату "qrc:/..."
- visible: true
- flags: Qt.FramelessWindowHint
- width: container.width * container.scale
- height: container.height * container.scale
- title: 'HomeScreen'
- API.CanBinding {
- id: binding
- }
- FontLoader {
- id: fontZekton
- source: "qrc:/fonts/zekton rg.ttf"
- }
- FontLoader {
- id: fontStormfaze
- source: "qrc:/fonts/stormfaze.ttf"
- }
- Rectangle {
- id: container
- width: 1280
- height: 768
- // TODO: Check if everything inside root will scale according to root rescaling
- scale: 1.0
- anchors.centerIn: parent
- color: "black"
- RowLayout {
- width: container.width - 2 * 20
- anchors.centerIn: parent
- spacing: 20
- LeftControlButtons {}
- ColumnLayout {
- id: centerCol
- Layout.preferredWidth: 1000
- Layout.preferredHeight: container.height
- spacing: 0
- TopArea {
- id: topArea
- Layout.preferredWidth: parent.width
- Layout.preferredHeight: 50
- }
- Loader {
- id: applicationLoader
- Layout.preferredWidth: parent.width
- Layout.preferredHeight: 620
- source: wm.displayedWindowUrl
- }
- BottomArea {
- id: bottomArea
- Layout.preferredWidth: parent.width
- Layout.preferredHeight: 50
- }
- }
- RightControlButtons {}
- }
- Rectangle {
- id: volumeBarContainer
- width: 850
- height: 80
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 40
- anchors.horizontalCenter: parent.horizontalCenter
- visible: false
- VolumeBar {}
- }
- }
- Popup {
- id: callPopup
- Connections {
- target: binding
- onIncomingCallStChanged: callPopup.open()
- }
- width: 400
- height: 200
- anchors.centerIn: parent
- topPadding: 50
- leftPadding: 100
- closePolicy: Popup.NoAutoClose
- background: Rectangle {
- radius: 3
- opacity: 0.9
- color: "#777F89"
- visible: true
- }
- enter: Transition {
- NumberAnimation { property: "opacity"; from: 0.0; to: 0.8 }
- }
- exit: Transition {
- NumberAnimation { property: "opacity"; from: 0.8; to: 0.0 }
- }
- contentItem: RowLayout {
- spacing: 40
- Rectangle {
- width: phoneRejectImg.width
- height: phoneRejectImg.height
- Image {
- id: phoneRejectImg
- width: 60
- anchors.centerIn: parent
- source: "../../images/homescreen/phoneReject.png"
- fillMode: Image.PreserveAspectFit
- }
- MouseArea {
- anchors.centerIn: parent
- width: parent.width * 1.2
- height: parent.height * 1.2
- onPressed: binding.rejectCallPressed()
- onReleased: { binding.rejectCallReleased(); callPopup.close(); }
- }
- }
- Rectangle {
- width: phoneAnswerImg.width
- height: phoneAnswerImg.height
- Image {
- id: phoneAnswerImg
- width: 60
- anchors.centerIn: parent
- source: "../../images/homescreen/phoneAnswer.png"
- fillMode: Image.PreserveAspectFit
- }
- MouseArea {
- anchors.centerIn: parent
- width: parent.width * 1.2
- height: parent.height * 1.2
- onPressed: binding.answerCallPressed()
- onReleased: { binding.answerCallReleased(); callPopup.close(); }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement