1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-08 06:25:37 -05:00

Update initial focus on IPC Notifications & Notepad

This commit is contained in:
purian23
2025-09-05 23:40:09 -04:00
parent 5f97fd4f7c
commit c9d7641d86
3 changed files with 31 additions and 3 deletions

View File

@@ -20,6 +20,17 @@ DankModal {
if (modalKeyboardController && notificationListRef) { if (modalKeyboardController && notificationListRef) {
modalKeyboardController.listView = notificationListRef modalKeyboardController.listView = notificationListRef
modalKeyboardController.rebuildFlatNavigation() modalKeyboardController.rebuildFlatNavigation()
Qt.callLater(() => {
modalKeyboardController.keyboardNavigationActive = true
modalKeyboardController.selectedFlatIndex = 0
modalKeyboardController.updateSelectedIdFromIndex()
if (notificationListRef) {
notificationListRef.keyboardActive = true
}
modalKeyboardController.selectionVersion++
modalKeyboardController.ensureVisible()
})
} }
} }

View File

@@ -36,6 +36,7 @@ PanelWindow {
function show() { function show() {
notepadVisible = true notepadVisible = true
Qt.callLater(() => textArea.forceActiveFocus())
} }
function hide() { function hide() {
@@ -381,9 +382,6 @@ PanelWindow {
repeat: false repeat: false
onTriggered: { onTriggered: {
animatingOut = false animatingOut = false
currentFileName = ""
currentFileUrl = ""
hasUnsavedChanges = false
} }
} }

View File

@@ -138,6 +138,22 @@ QtObject {
ensureVisible() ensureVisible()
} }
function selectNextWrapping() {
keyboardNavigationActive = true
if (flatNavigation.length === 0)
return
// Re-enable auto-scrolling when arrow keys are used
if (listView && listView.enableAutoScroll) {
listView.enableAutoScroll()
}
selectedFlatIndex = (selectedFlatIndex + 1) % flatNavigation.length
updateSelectedIdFromIndex()
selectionVersion++
ensureVisible()
}
function selectPrevious() { function selectPrevious() {
keyboardNavigationActive = true keyboardNavigationActive = true
if (flatNavigation.length === 0) if (flatNavigation.length === 0)
@@ -408,6 +424,9 @@ QtObject {
} else if (event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace) { } else if (event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace) {
clearSelected() clearSelected()
event.accepted = true event.accepted = true
} else if (event.key === Qt.Key_Tab) {
selectNextWrapping()
event.accepted = true
} else if (event.key >= Qt.Key_1 && event.key <= Qt.Key_9) { } else if (event.key >= Qt.Key_1 && event.key <= Qt.Key_9) {
const actionIndex = event.key - Qt.Key_1 const actionIndex = event.key - Qt.Key_1
executeAction(actionIndex) executeAction(actionIndex)