mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-02 03:28:28 -04:00
dash: allow hiding all tabs
port 1.5
This commit is contained in:
@@ -1105,13 +1105,12 @@ Item {
|
||||
|
||||
onClockClicked: {
|
||||
const section = topBarContent.getWidgetSection(parent) || "center";
|
||||
const tabIndex = SettingsData.dashTabIndexForId("overview");
|
||||
topBarContent.openWidgetPopout({
|
||||
loader: dankDashPopoutLoader,
|
||||
widgetItem: clockWidget,
|
||||
section,
|
||||
tabIndex,
|
||||
triggerSource: topBarContent._dashTriggerSource(section, tabIndex),
|
||||
triggerSource: topBarContent._dashTriggerSource(section, "overview"),
|
||||
prepare: popout => popout.requestTab("overview"),
|
||||
mode: "click",
|
||||
useCenterSection: true,
|
||||
setTriggerScreen: true
|
||||
@@ -1134,13 +1133,12 @@ Item {
|
||||
parentScreen: barWindow.screen
|
||||
onClicked: {
|
||||
const section = topBarContent.getWidgetSection(parent) || "center";
|
||||
const tabIndex = SettingsData.dashTabIndexForId("media");
|
||||
topBarContent.openWidgetPopout({
|
||||
loader: dankDashPopoutLoader,
|
||||
widgetItem: mediaWidget,
|
||||
section,
|
||||
tabIndex,
|
||||
triggerSource: topBarContent._dashTriggerSource(section, tabIndex),
|
||||
triggerSource: topBarContent._dashTriggerSource(section, "media"),
|
||||
prepare: popout => popout.requestTab("media"),
|
||||
mode: "click",
|
||||
useCenterSection: true,
|
||||
setTriggerScreen: true
|
||||
@@ -1162,13 +1160,12 @@ Item {
|
||||
parentScreen: barWindow.screen
|
||||
onClicked: {
|
||||
const section = topBarContent.getWidgetSection(parent) || "center";
|
||||
const tabIndex = SettingsData.dashTabIndexForId("weather");
|
||||
topBarContent.openWidgetPopout({
|
||||
loader: dankDashPopoutLoader,
|
||||
widgetItem: weatherWidget,
|
||||
section,
|
||||
tabIndex,
|
||||
triggerSource: topBarContent._dashTriggerSource(section, tabIndex),
|
||||
triggerSource: topBarContent._dashTriggerSource(section, "weather"),
|
||||
prepare: popout => popout.requestTab("weather"),
|
||||
mode: "click",
|
||||
useCenterSection: true,
|
||||
setTriggerScreen: true
|
||||
|
||||
@@ -736,11 +736,11 @@ Item {
|
||||
case "music":
|
||||
case "weather":
|
||||
{
|
||||
const tabIndex = SettingsData.dashTabIndexForId(widgetId === "clock" ? "overview" : (widgetId === "music" ? "media" : "weather"));
|
||||
const tabId = widgetId === "clock" ? "overview" : (widgetId === "music" ? "media" : "weather");
|
||||
return barContent.openWidgetPopout(Object.assign({}, base, {
|
||||
loader,
|
||||
tabIndex,
|
||||
triggerSource: dashTriggerSource(section, tabIndex),
|
||||
triggerSource: dashTriggerSource(section, tabId),
|
||||
prepare: popout => popout.requestTab(tabId),
|
||||
useCenterSection: true,
|
||||
setTriggerScreen: true
|
||||
}));
|
||||
|
||||
@@ -65,7 +65,7 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
function triggerDashTab(tabIndex) {
|
||||
function triggerDashTab(tabId) {
|
||||
dankDashPopoutLoader.active = true;
|
||||
if (!dankDashPopoutLoader.item) {
|
||||
return false;
|
||||
@@ -103,12 +103,14 @@ PanelWindow {
|
||||
dankDashPopoutLoader.item.triggerScreen = barWindow.screen;
|
||||
}
|
||||
|
||||
PopoutManager.requestPopout(dankDashPopoutLoader.item, tabIndex, (barConfig?.id ?? "default") + "-" + section + "-" + tabIndex);
|
||||
if (dankDashPopoutLoader.item.requestTab)
|
||||
dankDashPopoutLoader.item.requestTab(tabId);
|
||||
PopoutManager.requestPopout(dankDashPopoutLoader.item, undefined, (barConfig?.id ?? "default") + "-" + section + "-" + tabId);
|
||||
return true;
|
||||
}
|
||||
|
||||
function triggerWallpaperBrowser() {
|
||||
triggerDashTab(SettingsData.dashTabIndexForId("wallpaper"));
|
||||
triggerDashTab("wallpaper");
|
||||
}
|
||||
|
||||
readonly property bool usesOverlayLayer: CompositorService.framePeerSurfacesUseOverlayForScreen(barWindow.screen) || (barConfig?.useOverlayLayer ?? false)
|
||||
|
||||
Reference in New Issue
Block a user