diff --git a/panels/notification/center/GroupNotify.qml b/panels/notification/center/GroupNotify.qml index 29c607a54..7a17299f4 100644 --- a/panels/notification/center/GroupNotify.qml +++ b/panels/notification/center/GroupNotify.qml @@ -13,6 +13,8 @@ NotifyItem { id: root implicitWidth: impl.implicitWidth implicitHeight: impl.implicitHeight + property bool focusedByNavigation: false + onActiveFocusChanged: if (!activeFocus) focusedByNavigation = false signal collapse() signal gotoNextItem() // Signal to navigate to next notify item diff --git a/panels/notification/center/NormalNotify.qml b/panels/notification/center/NormalNotify.qml index ee9192106..35da81e7e 100644 --- a/panels/notification/center/NormalNotify.qml +++ b/panels/notification/center/NormalNotify.qml @@ -14,6 +14,9 @@ NotifyItem { implicitWidth: impl.implicitWidth implicitHeight: impl.implicitHeight + property bool focusedByNavigation: false + onActiveFocusChanged: if (!activeFocus) focusedByNavigation = false + signal gotoNextItem() signal gotoPrevItem() @@ -59,7 +62,7 @@ NotifyItem { actions: root.actions defaultAction: root.defaultAction // Show close button when: mouse hovers, or item has focus from keyboard navigation - parentHovered: impl.hovered || root.activeFocus + parentHovered: impl.hovered || (root.activeFocus && root.focusedByNavigation) strongInteractive: root.strongInteractive contentIcon: root.contentIcon contentRowCount: root.contentRowCount diff --git a/panels/notification/center/NotifyView.qml b/panels/notification/center/NotifyView.qml index 93db32f54..e235a7df4 100644 --- a/panels/notification/center/NotifyView.qml +++ b/panels/notification/center/NotifyView.qml @@ -38,6 +38,7 @@ Control { function tryFocus(retries) { let item = view.itemAtIndex(idx) if (item && item.enabled) { + item.focusedByNavigation = true item.resetFocus() if (!item.focusFirstButton()) { item.forceActiveFocus() diff --git a/panels/notification/center/NotifyViewDelegate.qml b/panels/notification/center/NotifyViewDelegate.qml index bbec8e4b9..51480a659 100644 --- a/panels/notification/center/NotifyViewDelegate.qml +++ b/panels/notification/center/NotifyViewDelegate.qml @@ -26,6 +26,7 @@ DelegateChooser { Qt.callLater(function() { let nextItem = view.itemAtIndex(currentIndex + 1) if (nextItem && nextItem.enabled) { + nextItem.focusedByNavigation = true nextItem.resetFocus() nextItem.forceActiveFocus() } @@ -43,6 +44,7 @@ DelegateChooser { Qt.callLater(function() { let prevItem = view.itemAtIndex(currentIndex - 1) if (prevItem && prevItem.enabled) { + prevItem.focusedByNavigation = true prevItem.forceActiveFocus() } }) diff --git a/panels/notification/center/OverlapNotify.qml b/panels/notification/center/OverlapNotify.qml index 36aed924b..a2722bf87 100644 --- a/panels/notification/center/OverlapNotify.qml +++ b/panels/notification/center/OverlapNotify.qml @@ -20,6 +20,9 @@ NotifyItem { property var removedCallback property alias notifyContent: notifyContent + property bool focusedByNavigation: false + onActiveFocusChanged: if (!activeFocus) focusedByNavigation = false + signal expand() signal gotoNextItem() signal gotoPrevItem() @@ -107,7 +110,7 @@ NotifyItem { actions: root.actions defaultAction: root.defaultAction // Show close button when: mouse hovers, or item has focus from keyboard navigation - parentHovered: impl.hovered || root.activeFocus + parentHovered: impl.hovered || (root.activeFocus && root.focusedByNavigation) strongInteractive: root.strongInteractive contentIcon: root.contentIcon contentRowCount: root.contentRowCount