Skip to content

Commit 2e60b85

Browse files
committed
refactor(ProcessListModal): toggle() delegates to show() to avoid code duplication
toggle(tabIndex) now calls show(tabIndex) instead of duplicating clampTab, currentTab assignment, and visible = true. No functional change — the hide-or-show semantics are identical.
1 parent 3019d7f commit 2e60b85

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

quickshell/Modals/ProcessListModal.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ FloatingWindow {
5959
log.warn("dgop is not available");
6060
return;
6161
}
62-
const targetTab = clampTab(tabIndex);
63-
if (visible && currentTab === targetTab) {
62+
// If already visible on the target tab, just hide.
63+
// Otherwise delegate to show() which handles clampTab, sort state, and visibility.
64+
if (visible && currentTab === clampTab(tabIndex)) {
6465
hide();
6566
return;
6667
}
67-
currentTab = targetTab;
68-
visible = true;
68+
show(tabIndex);
6969
}
7070

7171
function focusOrToggle() {

0 commit comments

Comments
 (0)