mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-15 02:02:08 -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 var historyListRef: null
|
||||||
property int currentTab: 0
|
property int currentTab: 0
|
||||||
|
|
||||||
|
property var notificationHeaderRef: null
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
notificationModalOpen = true;
|
notificationModalOpen = true;
|
||||||
currentTab = 0;
|
currentTab = 0;
|
||||||
@@ -89,6 +91,23 @@ DankModal {
|
|||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
return;
|
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) {
|
if (currentTab === 1 && historyListRef) {
|
||||||
historyListRef.handleKey(event);
|
historyListRef.handleKey(event);
|
||||||
return;
|
return;
|
||||||
@@ -161,6 +180,7 @@ DankModal {
|
|||||||
id: notificationHeader
|
id: notificationHeader
|
||||||
keyboardController: modalKeyboardController
|
keyboardController: modalKeyboardController
|
||||||
onCurrentTabChanged: notificationModal.currentTab = currentTab
|
onCurrentTabChanged: notificationModal.currentTab = currentTab
|
||||||
|
Component.onCompleted: notificationModal.notificationHeaderRef = notificationHeader
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationSettings {
|
NotificationSettings {
|
||||||
|
|||||||
@@ -149,6 +149,23 @@ DankPopout {
|
|||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
return;
|
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) {
|
if (notificationHeader.currentTab === 1) {
|
||||||
historyList.handleKey(event);
|
historyList.handleKey(event);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user