Advertisement
ktv6

Untitled

Dec 17th, 2020
2,949
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 4.56 KB | None | 0 0
  1. import QtQuick 2.9
  2. import QtQuick.Controls 2.5
  3. import QtQuick.Layouts 1.3
  4. import 'api' as API
  5.  
  6. ApplicationWindow {
  7.     // TODO: Перед релизом привести пути всех
  8.     //       изображений в коде к формату "qrc:/..."
  9.  
  10.     visible: true
  11.     flags: Qt.FramelessWindowHint
  12.     width: container.width * container.scale
  13.     height: container.height * container.scale
  14.     title: 'HomeScreen'
  15.  
  16.     API.CanBinding {
  17.         id: binding
  18.     }
  19.  
  20.     FontLoader {
  21.         id: fontZekton
  22.         source: "qrc:/fonts/zekton rg.ttf"
  23.     }
  24.  
  25.     FontLoader {
  26.         id: fontStormfaze
  27.         source: "qrc:/fonts/stormfaze.ttf"
  28.     }
  29.  
  30.     Rectangle {
  31.         id: container
  32.         width: 1280
  33.         height: 768
  34.         // TODO: Check if everything inside root will scale according to root rescaling
  35.         scale: 1.0
  36.  
  37.         anchors.centerIn: parent
  38.  
  39.         color: "black"
  40.  
  41.         RowLayout {
  42.             width: container.width - 2 * 20
  43.             anchors.centerIn: parent
  44.             spacing: 20
  45.  
  46.             LeftControlButtons {}
  47.  
  48.             ColumnLayout {
  49.                 id: centerCol
  50.                 Layout.preferredWidth:  1000
  51.                 Layout.preferredHeight: container.height
  52.                 spacing: 0
  53.  
  54.                 TopArea {
  55.                     id: topArea
  56.                     Layout.preferredWidth: parent.width
  57.                     Layout.preferredHeight: 50
  58.                 }
  59.  
  60.                 Loader {
  61.                     id: applicationLoader
  62.                     Layout.preferredWidth: parent.width
  63.                     Layout.preferredHeight: 620
  64.  
  65.                     source: wm.displayedWindowUrl
  66.                 }
  67.  
  68.                 BottomArea {
  69.                     id: bottomArea
  70.                     Layout.preferredWidth: parent.width
  71.                     Layout.preferredHeight: 50
  72.                 }
  73.             }
  74.  
  75.             RightControlButtons {}
  76.         }
  77.  
  78.         Rectangle {
  79.             id: volumeBarContainer
  80.  
  81.             width: 850
  82.             height: 80
  83.  
  84.             anchors.bottom: parent.bottom
  85.             anchors.bottomMargin: 40
  86.             anchors.horizontalCenter: parent.horizontalCenter
  87.  
  88.             visible: false
  89.             VolumeBar {}
  90.         }
  91.     }
  92.  
  93.     Popup {
  94.         id: callPopup
  95.  
  96.         Connections {
  97.             target: binding
  98.             onIncomingCallStChanged: callPopup.open()
  99.         }
  100.  
  101.         width: 400
  102.         height: 200
  103.  
  104.         anchors.centerIn: parent
  105.  
  106.         topPadding: 50
  107.         leftPadding: 100
  108.  
  109.         closePolicy: Popup.NoAutoClose
  110.  
  111.         background:  Rectangle {
  112.             radius: 3
  113.             opacity: 0.9
  114.             color: "#777F89"
  115.             visible: true
  116.         }
  117.  
  118.         enter: Transition {
  119.             NumberAnimation { property: "opacity"; from: 0.0; to: 0.8 }
  120.         }
  121.  
  122.         exit: Transition {
  123.             NumberAnimation { property: "opacity"; from: 0.8; to: 0.0 }
  124.         }
  125.  
  126.         contentItem: RowLayout {
  127.             spacing: 40
  128.  
  129.             Rectangle {
  130.                 width: phoneRejectImg.width
  131.                 height: phoneRejectImg.height
  132.  
  133.                 Image {
  134.                     id: phoneRejectImg
  135.  
  136.                     width: 60
  137.                     anchors.centerIn: parent
  138.  
  139.                     source: "../../images/homescreen/phoneReject.png"
  140.                     fillMode: Image.PreserveAspectFit
  141.                 }
  142.  
  143.                 MouseArea {
  144.                     anchors.centerIn: parent
  145.  
  146.                     width: parent.width * 1.2
  147.                     height: parent.height * 1.2
  148.  
  149.                     onPressed: binding.rejectCallPressed()
  150.                     onReleased: { binding.rejectCallReleased(); callPopup.close(); }
  151.                 }
  152.             }
  153.  
  154.             Rectangle {
  155.                 width: phoneAnswerImg.width
  156.                 height: phoneAnswerImg.height
  157.  
  158.                 Image {
  159.                     id: phoneAnswerImg
  160.  
  161.                     width: 60
  162.                     anchors.centerIn: parent
  163.  
  164.                     source: "../../images/homescreen/phoneAnswer.png"
  165.                     fillMode: Image.PreserveAspectFit
  166.                 }
  167.  
  168.                 MouseArea {
  169.                     anchors.centerIn: parent
  170.  
  171.                     width: parent.width * 1.2
  172.                     height: parent.height * 1.2
  173.  
  174.                     onPressed: binding.answerCallPressed()
  175.                     onReleased: { binding.answerCallReleased(); callPopup.close(); }
  176.                 }
  177.             }
  178.         }
  179.     }
  180. }
  181.  
  182.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement