diff --git a/osd/NotificationPanel.qml b/osd/NotificationPanel.qml index 0fee388..5713363 100644 --- a/osd/NotificationPanel.qml +++ b/osd/NotificationPanel.qml @@ -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,18 +59,29 @@ Scope { color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent" } - ColumnLayout { - 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 + MouseArea { + id: notificationArea + anchors.fill: parent + hoverEnabled: true + onExited: () => { + hideTimer.restart(); + } + onEntered: () => { + hideTimer.stop(); + } + ColumnLayout { + 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 + } } } }