Added to notification panel to hide when no notifications or when moused off
This commit is contained in:
@@ -11,16 +11,26 @@ Scope {
|
|||||||
property bool visible: false
|
property bool visible: false
|
||||||
property int panelWidth: 350
|
property int panelWidth: 350
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: hideTimer
|
||||||
|
interval: Config.options.osd.timeout
|
||||||
|
onTriggered: GlobalStates.notificationPanelOpen = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: quickHideTimer
|
||||||
|
interval: 1
|
||||||
|
onTriggered: GlobalStates.notificationPanelOpen = false
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: notificationPanelLoader
|
id: notificationPanelLoader
|
||||||
active: GlobalStates.notificationPanelOpen
|
active: GlobalStates.notificationPanelOpen
|
||||||
/**
|
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
if (!notificationPanelLoader.active & NotificationServer.amountNotifications == 0) {
|
if (notificationPanelLoader.active & NotificationService.amountNotifications == 0) {
|
||||||
GlobalStates.notificationPanelOpen = false;
|
quickHideTimer.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//*/
|
|
||||||
|
|
||||||
sourceComponent: PanelWindow {
|
sourceComponent: PanelWindow {
|
||||||
id: notificationPanelRoot
|
id: notificationPanelRoot
|
||||||
@@ -49,18 +59,29 @@ Scope {
|
|||||||
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
|
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
MouseArea {
|
||||||
id: notifs
|
id: notificationArea
|
||||||
anchors.margins: 4
|
anchors.fill: parent
|
||||||
anchors.left: parent.left
|
hoverEnabled: true
|
||||||
anchors.right: parent.right
|
onExited: () => {
|
||||||
Repeater {
|
hideTimer.restart();
|
||||||
model: NotificationService.notifications
|
}
|
||||||
NotificationItem {
|
onEntered: () => {
|
||||||
required property Notification modelData
|
hideTimer.stop();
|
||||||
notif: modelData
|
}
|
||||||
textWidth: root.panelWidth - 14
|
ColumnLayout {
|
||||||
notificationRounding: Appearance.rounding.unsharpenmore
|
id: notifs
|
||||||
|
anchors.margins: 4
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
Repeater {
|
||||||
|
model: NotificationService.notifications
|
||||||
|
NotificationItem {
|
||||||
|
required property Notification modelData
|
||||||
|
notif: modelData
|
||||||
|
textWidth: root.panelWidth - 14
|
||||||
|
notificationRounding: Appearance.rounding.unsharpenmore
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user