1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

processlist: add full keyboard navigation

This commit is contained in:
bbedward
2026-01-18 21:03:34 -05:00
parent 0f6ae11c3d
commit ac68451cdf
5 changed files with 507 additions and 154 deletions

View File

@@ -42,6 +42,8 @@ DankPopout {
if (!shouldBeVisible) {
searchText = "";
expandedPid = "";
if (processesView)
processesView.reset();
}
}
@@ -69,9 +71,13 @@ DankPopout {
if (processListPopout.shouldBeVisible)
forceActiveFocus();
processContextMenu.parent = processListContent;
processContextMenu.parentFocusItem = processListContent;
}
Keys.onPressed: event => {
if (processContextMenu.visible)
return;
switch (event.key) {
case Qt.Key_Escape:
if (processListPopout.searchText.length > 0) {
@@ -79,6 +85,11 @@ DankPopout {
event.accepted = true;
return;
}
if (processesView.keyboardNavigationActive) {
processesView.reset();
event.accepted = true;
return;
}
processListPopout.close();
event.accepted = true;
return;
@@ -90,14 +101,15 @@ DankPopout {
}
break;
}
processesView.handleKey(event);
}
Connections {
target: processListPopout
function onShouldBeVisibleChanged() {
if (processListPopout.shouldBeVisible) {
if (processListPopout.shouldBeVisible)
Qt.callLater(() => processListContent.forceActiveFocus());
}
}
}
@@ -142,6 +154,8 @@ DankPopout {
showClearButton: true
text: processListPopout.searchText
onTextChanged: processListPopout.searchText = text
ignoreUpDownKeys: true
keyForwardTargets: [processListContent]
}
}
@@ -314,6 +328,7 @@ DankPopout {
clip: true
ProcessesView {
id: processesView
anchors.fill: parent
anchors.margins: Theme.spacingS
searchText: processListPopout.searchText