1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 22:12:50 -05:00

ipc/focus: add focusOrToggle to settings and processlist

This commit is contained in:
bbedward
2025-12-01 23:16:06 -05:00
parent 89aa146845
commit 344c4f9385
8 changed files with 66 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Wayland
import qs.Common
import qs.Modules.ProcessList
import qs.Services
@@ -39,6 +40,27 @@ FloatingWindow {
visible = !visible;
}
function focusOrToggle() {
if (!DgopService.dgopAvailable) {
console.warn("ProcessListModal: dgop is not available");
return;
}
if (visible) {
const modalTitle = I18n.tr("System Monitor", "sysmon window title");
for (const toplevel of ToplevelManager.toplevels.values) {
if (toplevel.title !== "System Monitor" && toplevel.title !== modalTitle)
continue;
if (toplevel.activated) {
hide();
return;
}
toplevel.activate();
return;
}
}
show();
}
objectName: "processListModal"
title: I18n.tr("System Monitor", "sysmon window title")
minimumSize: Qt.size(650, 400)