1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 04:42:05 -04:00

process list: add all/user/system filters

This commit is contained in:
bbedward
2026-02-17 11:25:05 -05:00
parent d6650be008
commit 92a25fdb6a
20 changed files with 1555 additions and 346 deletions

View File

@@ -14,6 +14,7 @@ DankPopout {
property var triggerScreen: null
property string searchText: ""
property string expandedPid: ""
property string processFilter: "all"
function hide() {
close();
@@ -42,6 +43,7 @@ DankPopout {
if (!shouldBeVisible) {
searchText = "";
expandedPid = "";
processFilter = "all";
}
}
@@ -110,6 +112,7 @@ DankPopout {
Qt.callLater(() => searchField.forceActiveFocus());
} else {
processesView.reset();
processFilterGroup.currentIndex = 0;
}
}
}
@@ -146,6 +149,32 @@ DankPopout {
Layout.fillWidth: true
}
DankButtonGroup {
id: processFilterGroup
Layout.minimumWidth: implicitWidth + 8
model: [I18n.tr("All"), I18n.tr("User"), I18n.tr("System")]
currentIndex: 0
checkEnabled: false
buttonHeight: Math.round(Theme.fontSizeMedium * 2.2)
textSize: Theme.fontSizeSmall
onSelectionChanged: (index, selected) => {
if (!selected)
return;
currentIndex = index;
switch (index) {
case 0:
processListPopout.processFilter = "all";
return;
case 1:
processListPopout.processFilter = "user";
return;
case 2:
processListPopout.processFilter = "system";
return;
}
}
}
DankTextField {
id: searchField
Layout.preferredWidth: Theme.fontSizeMedium * 14
@@ -334,6 +363,7 @@ DankPopout {
anchors.margins: Theme.spacingS
searchText: processListPopout.searchText
expandedPid: processListPopout.expandedPid
processFilter: processListPopout.processFilter
contextMenu: processContextMenu
onExpandedPidChanged: processListPopout.expandedPid = expandedPid
}

View File

@@ -11,6 +11,7 @@ Item {
property string searchText: ""
property string expandedPid: ""
property var contextMenu: null
property string processFilter: "all" // "all", "user", "system"
property int selectedIndex: -1
property bool keyboardNavigationActive: false
@@ -41,6 +42,12 @@ Item {
let procs = DgopService.allProcesses.slice();
if (processFilter === "user") {
procs = procs.filter(p => p.username === UserInfoService.username);
} else if (processFilter === "system") {
procs = procs.filter(p => p.username !== UserInfoService.username);
}
if (searchText.length > 0) {
const search = searchText.toLowerCase();
procs = procs.filter(p => {

View File

@@ -262,7 +262,7 @@ Item {
}
StyledText {
text: I18n.tr("Hidden (%1)").arg(root.hiddenOutputDeviceNames.length)
text: I18n.tr("Hidden (%1)", "count of hidden audio devices").arg(root.hiddenOutputDeviceNames.length)
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
anchors.verticalCenter: parent.verticalCenter
@@ -406,7 +406,7 @@ Item {
}
StyledText {
text: I18n.tr("Hidden (%1)").arg(root.hiddenInputDeviceNames.length)
text: I18n.tr("Hidden (%1)", "count of hidden audio devices").arg(root.hiddenInputDeviceNames.length)
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
anchors.verticalCenter: parent.verticalCenter