1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-03 12:08:31 -04:00

dash: allow hiding all tabs

port 1.5
This commit is contained in:
bbedward
2026-07-13 16:11:15 -04:00
parent e3034e4e94
commit 7535b70fa6
9 changed files with 85 additions and 101 deletions
+18 -9
View File
@@ -214,7 +214,7 @@ Singleton {
property bool _dankDashWantsOpen: false
property bool _dankDashWantsToggle: false
property int _dankDashPendingTab: 0
property var _dankDashPendingTab: 0
property real _dankDashPendingX: 0
property real _dankDashPendingY: 0
property real _dankDashPendingWidth: 0
@@ -231,12 +231,21 @@ Singleton {
_dankDashHasPosition = hasPos;
}
function openDankDash(tabIndex, x, y, width, section, screen) {
_dankDashPendingTab = tabIndex || 0;
// `tab` is a view id ("weather"); a numeric index into the visible tabs is
// still accepted for plugin compatibility.
function _dankDashTabId(tab) {
if (typeof tab === "string" && tab !== "")
return tab;
const ids = SettingsData.visibleDashTabIds();
return ids[typeof tab === "number" ? tab : 0] ?? "overview";
}
function openDankDash(tab, x, y, width, section, screen) {
_dankDashPendingTab = tab || 0;
if (dankDashPopout) {
if (arguments.length >= 6)
setPosition(dankDashPopout, x, y, width, section, screen);
dankDashPopout.currentTabIndex = _dankDashPendingTab;
dankDashPopout.requestTab(_dankDashTabId(_dankDashPendingTab));
dankDashPopout.dashVisible = true;
return;
}
@@ -259,15 +268,15 @@ Singleton {
// bindings while Qt is still unwinding the signal stack.
}
function toggleDankDash(tabIndex, x, y, width, section, screen) {
_dankDashPendingTab = tabIndex || 0;
function toggleDankDash(tab, x, y, width, section, screen) {
_dankDashPendingTab = tab || 0;
if (dankDashPopout) {
if (arguments.length >= 6)
setPosition(dankDashPopout, x, y, width, section, screen);
if (dankDashPopout.dashVisible) {
dankDashPopout.dashVisible = false;
} else {
dankDashPopout.currentTabIndex = _dankDashPendingTab;
dankDashPopout.requestTab(_dankDashTabId(_dankDashPendingTab));
dankDashPopout.dashVisible = true;
}
return;
@@ -289,7 +298,7 @@ Singleton {
if (_dankDashWantsOpen) {
_dankDashWantsOpen = false;
dankDashPopout.currentTabIndex = _dankDashPendingTab;
dankDashPopout.requestTab(_dankDashTabId(_dankDashPendingTab));
dankDashPopout.dashVisible = true;
return;
}
@@ -298,7 +307,7 @@ Singleton {
if (dankDashPopout.dashVisible) {
dankDashPopout.dashVisible = false;
} else {
dankDashPopout.currentTabIndex = _dankDashPendingTab;
dankDashPopout.requestTab(_dankDashTabId(_dankDashPendingTab));
dankDashPopout.dashVisible = true;
}
}