From 4557426c286b2df0363b74e8eeaf34876dfbe074 Mon Sep 17 00:00:00 2001 From: bbedward Date: Sat, 7 Feb 2026 17:42:20 -0500 Subject: [PATCH] notifications: fix kb navigation breaking on history tab close --- quickshell/Modals/NotificationModal.qml | 1 + .../Center/HistoryNotificationCard.qml | 4 +++- .../Center/HistoryNotificationList.qml | 4 +++- .../KeyboardNavigatedNotificationList.qml | 9 ++++--- .../Notifications/Center/NotificationCard.qml | 24 +++++++++++-------- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/quickshell/Modals/NotificationModal.qml b/quickshell/Modals/NotificationModal.qml index c3b44554..b8d25100 100644 --- a/quickshell/Modals/NotificationModal.qml +++ b/quickshell/Modals/NotificationModal.qml @@ -23,6 +23,7 @@ DankModal { function show() { notificationModalOpen = true; + currentTab = 0; NotificationService.onOverlayOpen(); open(); modalKeyboardController.reset(); diff --git a/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml b/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml index d8079bb1..74829bb7 100644 --- a/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml @@ -14,7 +14,9 @@ Rectangle { property bool __initialized: false Component.onCompleted: { - Qt.callLater(() => { __initialized = true; }); + Qt.callLater(() => { + __initialized = true; + }); } readonly property bool compactMode: SettingsData.notificationCompactMode diff --git a/quickshell/Modules/Notifications/Center/HistoryNotificationList.qml b/quickshell/Modules/Notifications/Center/HistoryNotificationList.qml index 9fb16f90..d2faa6d7 100644 --- a/quickshell/Modules/Notifications/Center/HistoryNotificationList.qml +++ b/quickshell/Modules/Notifications/Center/HistoryNotificationList.qml @@ -256,7 +256,9 @@ Item { property bool __delegateInitialized: false Component.onCompleted: { - Qt.callLater(() => { __delegateInitialized = true; }); + Qt.callLater(() => { + __delegateInitialized = true; + }); } width: ListView.view.width diff --git a/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml b/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml index 0bcecd9e..1aec8674 100644 --- a/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml +++ b/quickshell/Modules/Notifications/Center/KeyboardNavigatedNotificationList.qml @@ -10,13 +10,14 @@ DankListView { property bool keyboardActive: false property bool autoScrollDisabled: false property bool isAnimatingExpansion: false - property alias count: listView.count property alias listContentHeight: listView.contentHeight property bool cardAnimateExpansion: true property bool listInitialized: false Component.onCompleted: { - Qt.callLater(() => { listInitialized = true; }); + Qt.callLater(() => { + listInitialized = true; + }); } clip: true @@ -86,7 +87,9 @@ DankListView { property bool __delegateInitialized: false Component.onCompleted: { - Qt.callLater(() => { __delegateInitialized = true; }); + Qt.callLater(() => { + __delegateInitialized = true; + }); } width: ListView.view.width diff --git a/quickshell/Modules/Notifications/Center/NotificationCard.qml b/quickshell/Modules/Notifications/Center/NotificationCard.qml index f97dbc8e..7e1c83f3 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCard.qml @@ -34,7 +34,9 @@ Rectangle { property bool __initialized: false Component.onCompleted: { - Qt.callLater(() => { __initialized = true; }); + Qt.callLater(() => { + __initialized = true; + }); } Behavior on border.color { @@ -353,7 +355,9 @@ Rectangle { property bool __delegateInitialized: false Component.onCompleted: { - Qt.callLater(() => { __delegateInitialized = true; }); + Qt.callLater(() => { + __delegateInitialized = true; + }); } width: parent.width @@ -530,13 +534,13 @@ Rectangle { Rectangle { property bool isHovered: false - width: Math.max(actionText.implicitWidth + Theme.spacingM, compactMode ? 40 : 50) + width: Math.max(expandedActionText.implicitWidth + Theme.spacingM, compactMode ? 40 : 50) height: actionButtonHeight radius: Theme.spacingXS color: isHovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : "transparent" StyledText { - id: actionText + id: expandedActionText text: { const baseText = modelData.text || "View"; if (keyboardNavigationActive && (isGroupSelected || selectedNotificationIndex >= 0)) @@ -567,13 +571,13 @@ Rectangle { Rectangle { property bool isHovered: false - width: Math.max(clearText.implicitWidth + Theme.spacingM, compactMode ? 40 : 50) + width: Math.max(expandedClearText.implicitWidth + Theme.spacingM, compactMode ? 40 : 50) height: actionButtonHeight radius: Theme.spacingXS color: isHovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : "transparent" StyledText { - id: clearText + id: expandedClearText text: I18n.tr("Dismiss") color: parent.isHovered ? Theme.primary : Theme.surfaceVariantText font.pixelSize: Theme.fontSizeSmall @@ -613,13 +617,13 @@ Rectangle { Rectangle { property bool isHovered: false - width: Math.max(actionText.implicitWidth + Theme.spacingM, compactMode ? 40 : 50) + width: Math.max(collapsedActionText.implicitWidth + Theme.spacingM, compactMode ? 40 : 50) height: actionButtonHeight radius: Theme.spacingXS color: isHovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : "transparent" StyledText { - id: actionText + id: collapsedActionText text: { const baseText = modelData.text || "View"; if (keyboardNavigationActive && isGroupSelected) { @@ -661,13 +665,13 @@ Rectangle { anchors.rightMargin: Theme.spacingL anchors.top: collapsedContent.bottom anchors.topMargin: contentSpacing - width: Math.max(clearText.implicitWidth + Theme.spacingM, compactMode ? 40 : 50) + width: Math.max(collapsedClearText.implicitWidth + Theme.spacingM, compactMode ? 40 : 50) height: actionButtonHeight radius: Theme.spacingXS color: isHovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : "transparent" StyledText { - id: clearText + id: collapsedClearText text: I18n.tr("Dismiss") color: clearButton.isHovered ? Theme.primary : Theme.surfaceVariantText font.pixelSize: Theme.fontSizeSmall