aboutsummaryrefslogtreecommitdiffstats
path: root/homescreen/qml/toppanel.qml
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-04-25 18:42:40 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-06-24 16:58:24 +0300
commiteb227c1da7bdd2d81c5a95881d7eef18369ca96a (patch)
treecd3f2adc8b0a9a207bc3d4bed97ae7a6a3747e0f /homescreen/qml/toppanel.qml
parentc903d2fc00c1129ae7c8c3f3393d7cd08c9f2699 (diff)
agl-compositor: Conversion to agl-compositor
Bug-AGL: SPEC-3447 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I7da44ec333217d355ba643d2d21bea7d8940ad2b
Diffstat (limited to 'homescreen/qml/toppanel.qml')
-rw-r--r--homescreen/qml/toppanel.qml69
1 files changed, 69 insertions, 0 deletions
diff --git a/homescreen/qml/toppanel.qml b/homescreen/qml/toppanel.qml
new file mode 100644
index 0000000..4098c73
--- /dev/null
+++ b/homescreen/qml/toppanel.qml
@@ -0,0 +1,69 @@
+import QtQuick 2.13
+import QtQuick.Window 2.13
+
+Window {
+ id: toppanel
+ width: Screen.width
+ height: Screen.height * (240.0 / 1920.0)
+ flags: Qt.FramelessWindowHint
+ visible: true
+ //color: "#aaaa0000"
+
+ TopArea {
+ }
+
+ Timer {
+ id:notificationTimer
+ interval: 3000
+ running: false
+ repeat: true
+ onTriggered: notificationItem.visible = false
+ }
+
+ Item {
+ id: notificationItem
+ x: 0
+ y: 0
+ z: 1
+ width: 1280
+ height: 100
+ opacity: 0.8
+ visible: false
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ anchors.fill: parent
+ color: "gray"
+ Image {
+ id: notificationIcon
+ width: 70
+ height: 70
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ anchors.verticalCenter: parent.verticalCenter
+ source: ""
+ }
+
+ Text {
+ id: notificationtext
+ font.pixelSize: 25
+ anchors.left: notificationIcon.right
+ anchors.leftMargin: 5
+ anchors.verticalCenter: parent.verticalCenter
+ color: "white"
+ text: qsTr("")
+ }
+ }
+ }
+
+ Connections {
+ target: homescreenHandler
+ onShowNotification: {
+ notificationIcon.source = icon_path
+ notificationtext.text = text
+ notificationItem.visible = true
+ notificationTimer.restart()
+ }
+ }
+}