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,6 +59,16 @@ Scope {
|
|||||||
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
|
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: notificationArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onExited: () => {
|
||||||
|
hideTimer.restart();
|
||||||
|
}
|
||||||
|
onEntered: () => {
|
||||||
|
hideTimer.stop();
|
||||||
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: notifs
|
id: notifs
|
||||||
anchors.margins: 4
|
anchors.margins: 4
|
||||||
@@ -67,3 +87,4 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user