diff --git a/quickshell/Modals/NotificationModal.qml b/quickshell/Modals/NotificationModal.qml index b8d25100..50bc1414 100644 --- a/quickshell/Modals/NotificationModal.qml +++ b/quickshell/Modals/NotificationModal.qml @@ -21,6 +21,8 @@ DankModal { property var historyListRef: null property int currentTab: 0 + property var notificationHeaderRef: null + function show() { notificationModalOpen = true; currentTab = 0; @@ -89,6 +91,23 @@ DankModal { event.accepted = true; return; } + + if (event.key === Qt.Key_Left) { + if (notificationHeaderRef && notificationHeaderRef.currentTab > 0) { + notificationHeaderRef.currentTab = 0; + event.accepted = true; + } + return; + } + + if (event.key === Qt.Key_Right) { + if (notificationHeaderRef && notificationHeaderRef.currentTab === 0 && SettingsData.notificationHistoryEnabled) { + notificationHeaderRef.currentTab = 1; + event.accepted = true; + } + return; + } + if (currentTab === 1 && historyListRef) { historyListRef.handleKey(event); return; @@ -161,6 +180,7 @@ DankModal { id: notificationHeader keyboardController: modalKeyboardController onCurrentTabChanged: notificationModal.currentTab = currentTab + Component.onCompleted: notificationModal.notificationHeaderRef = notificationHeader } NotificationSettings { diff --git a/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml b/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml index edb5cfb1..cbd0bbef 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml @@ -149,6 +149,23 @@ DankPopout { event.accepted = true; return; } + + if (event.key === Qt.Key_Left) { + if (notificationHeader.currentTab > 0) { + notificationHeader.currentTab = 0; + event.accepted = true; + } + return; + } + + if (event.key === Qt.Key_Right) { + if (notificationHeader.currentTab === 0 && SettingsData.notificationHistoryEnabled) { + notificationHeader.currentTab = 1; + event.accepted = true; + } + return; + } + if (notificationHeader.currentTab === 1) { historyList.handleKey(event); return;