1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 12:52:06 -04:00

notifications: Add Left/Right Keyboard Nav to Current/History tabs

This commit is contained in:
purian23
2026-02-10 20:51:13 -05:00
parent a337585b00
commit 9c4f4cbd0d
2 changed files with 37 additions and 0 deletions

View File

@@ -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 {