agl-compositor: Conversion to agl-compositor
[apps/homescreen.git] / homescreen / qml / toppanel.qml
1 import QtQuick 2.13
2 import QtQuick.Window 2.13
3
4 Window {
5     id: toppanel
6     width: Screen.width
7     height: Screen.height * (240.0 / 1920.0)
8     flags: Qt.FramelessWindowHint
9     visible: true
10     //color: "#aaaa0000"
11
12     TopArea {
13     }
14
15     Timer {
16         id:notificationTimer
17         interval: 3000
18         running: false
19         repeat: true
20         onTriggered: notificationItem.visible = false
21     }
22
23     Item {
24         id: notificationItem
25         x: 0
26         y: 0
27         z: 1
28         width: 1280
29         height: 100
30         opacity: 0.8
31         visible: false
32
33         Rectangle {
34             width: parent.width
35             height: parent.height
36             anchors.fill: parent
37             color: "gray"
38             Image {
39                 id: notificationIcon
40                 width: 70
41                 height: 70
42                 anchors.left: parent.left
43                 anchors.leftMargin: 20
44                 anchors.verticalCenter: parent.verticalCenter
45                 source: ""
46             }
47
48             Text {
49                 id: notificationtext
50                 font.pixelSize: 25
51                 anchors.left: notificationIcon.right
52                 anchors.leftMargin: 5
53                 anchors.verticalCenter: parent.verticalCenter
54                 color: "white"
55                 text: qsTr("")
56             }
57         }
58     }
59
60     Connections {
61         target: homescreenHandler
62         onShowNotification: {
63             notificationIcon.source = icon_path
64             notificationtext.text = text
65             notificationItem.visible = true
66             notificationTimer.restart()
67         }
68     }
69 }