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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user