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 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 {
|
||||
id: notificationPanelLoader
|
||||
active: GlobalStates.notificationPanelOpen
|
||||
/**
|
||||
onActiveChanged: {
|
||||
if (!notificationPanelLoader.active & NotificationServer.amountNotifications == 0) {
|
||||
GlobalStates.notificationPanelOpen = false;
|
||||
if (notificationPanelLoader.active & NotificationService.amountNotifications == 0) {
|
||||
quickHideTimer.restart();
|
||||
}
|
||||
}
|
||||
//*/
|
||||
|
||||
sourceComponent: PanelWindow {
|
||||
id: notificationPanelRoot
|
||||
@@ -49,6 +59,16 @@ Scope {
|
||||
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: notificationArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onExited: () => {
|
||||
hideTimer.restart();
|
||||
}
|
||||
onEntered: () => {
|
||||
hideTimer.stop();
|
||||
}
|
||||
ColumnLayout {
|
||||
id: notifs
|
||||
anchors.margins: 4
|
||||
@@ -67,3 +87,4 @@ Scope {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user