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

Sync up Frame w/Master branch updates

This commit is contained in:
purian23
2026-04-28 01:47:23 -04:00
parent e8b8d0a0bd
commit e983ab55ad
8 changed files with 58 additions and 76 deletions

View File

@@ -161,37 +161,36 @@ Item {
} }
IpcHandler { IpcHandler {
function resolveTabIndex(tab: string): int {
switch ((tab || "").toLowerCase()) {
case "media":
return 1;
case "wallpaper":
return 2;
case "weather":
return SettingsData.weatherEnabled ? 3 : 0;
default:
return 0;
}
}
function open(tab: string): string { function open(tab: string): string {
const bar = root.getPreferredBar("clockButtonRef"); const bar = root.getPreferredBar("clockButtonRef");
if (!bar) if (!bar)
return "DASH_OPEN_FAILED"; return "DASH_OPEN_FAILED";
const tabIndex = resolveTabIndex(tab);
const dash = root.dankDashPopoutLoader.item; const dash = root.dankDashPopoutLoader.item;
const onSameScreen = dash && dash.shouldBeVisible && dash.triggerScreen?.name === bar.screen?.name; if (dash && dash.shouldBeVisible && dash.triggerScreen?.name === bar.screen?.name) {
dash.currentTabIndex = tabIndex;
if (!onSameScreen) { if (dash.updateSurfacePosition)
bar.triggerWallpaperBrowser(); dash.updateSurfacePosition();
return "DASH_OPEN_SUCCESS";
} }
if (!root.dankDashPopoutLoader.item) if (!bar.triggerDashTab(tabIndex))
return "DASH_OPEN_FAILED"; return "DASH_OPEN_FAILED";
switch (tab.toLowerCase()) {
case "media":
root.dankDashPopoutLoader.item.currentTabIndex = 1;
break;
case "wallpaper":
root.dankDashPopoutLoader.item.currentTabIndex = 2;
break;
case "weather":
root.dankDashPopoutLoader.item.currentTabIndex = SettingsData.weatherEnabled ? 3 : 0;
break;
default:
root.dankDashPopoutLoader.item.currentTabIndex = 0;
break;
}
root.dankDashPopoutLoader.item.dashVisible = true;
return "DASH_OPEN_SUCCESS"; return "DASH_OPEN_SUCCESS";
} }
@@ -211,23 +210,8 @@ Item {
const bar = root.getPreferredBar("clockButtonRef"); const bar = root.getPreferredBar("clockButtonRef");
if (bar) { if (bar) {
bar.triggerWallpaperBrowser(); if (!bar.triggerDashTab(resolveTabIndex(tab)))
if (root.dankDashPopoutLoader.item) { return "DASH_TOGGLE_FAILED";
switch (tab.toLowerCase()) {
case "media":
root.dankDashPopoutLoader.item.currentTabIndex = 1;
break;
case "wallpaper":
root.dankDashPopoutLoader.item.currentTabIndex = 2;
break;
case "weather":
root.dankDashPopoutLoader.item.currentTabIndex = SettingsData.weatherEnabled ? 3 : 0;
break;
default:
root.dankDashPopoutLoader.item.currentTabIndex = 0;
break;
}
}
return "DASH_TOGGLE_SUCCESS"; return "DASH_TOGGLE_SUCCESS";
} }
return "DASH_TOGGLE_FAILED"; return "DASH_TOGGLE_FAILED";

View File

@@ -286,7 +286,11 @@ DankPopout {
id: editControls id: editControls
width: parent.width width: parent.width
visible: editMode visible: editMode
popoutContent: controlContent popupScreen: root.screen
popoutX: root.alignedX
popoutY: root.alignedY
popoutWidth: root.alignedWidth
popoutHeight: root.alignedHeight
availableWidgets: { availableWidgets: {
if (!editMode) if (!editMode)
return []; return [];

View File

@@ -42,10 +42,10 @@ PanelWindow {
} }
} }
function triggerWallpaperBrowser() { function triggerDashTab(tabIndex) {
dankDashPopoutLoader.active = true; dankDashPopoutLoader.active = true;
if (!dankDashPopoutLoader.item) { if (!dankDashPopoutLoader.item) {
return; return false;
} }
let section = "center"; let section = "center";
@@ -81,7 +81,12 @@ PanelWindow {
dankDashPopoutLoader.item.triggerScreen = barWindow.screen; dankDashPopoutLoader.item.triggerScreen = barWindow.screen;
} }
PopoutManager.requestPopout(dankDashPopoutLoader.item, 2, (barConfig?.id ?? "default") + "-" + section + "-2"); PopoutManager.requestPopout(dankDashPopoutLoader.item, tabIndex, (barConfig?.id ?? "default") + "-" + section + "-" + tabIndex);
return true;
}
function triggerWallpaperBrowser() {
triggerDashTab(2);
} }
readonly property var dBarLayer: { readonly property var dBarLayer: {

View File

@@ -1412,6 +1412,10 @@ Item {
property: "value" property: "value"
value: selectedBarConfig?.widgetOutlineThickness ?? 1 value: selectedBarConfig?.widgetOutlineThickness ?? 1
restoreMode: Binding.RestoreBinding restoreMode: Binding.RestoreBinding
}
}
}
Item { Item {
visible: dankBarTab.connectedFrameModeActive visible: dankBarTab.connectedFrameModeActive
width: parent.width width: parent.width

View File

@@ -46,6 +46,7 @@ Item {
readonly property var contentLoader: impl.item ? impl.item.contentLoader : _fallbackContentLoader readonly property var contentLoader: impl.item ? impl.item.contentLoader : _fallbackContentLoader
readonly property var overlayLoader: impl.item ? impl.item.overlayLoader : _fallbackOverlayLoader readonly property var overlayLoader: impl.item ? impl.item.overlayLoader : _fallbackOverlayLoader
readonly property var backgroundWindow: impl.item ? impl.item.backgroundWindow : null
Loader { Loader {
id: _fallbackContentLoader id: _fallbackContentLoader

View File

@@ -14,6 +14,7 @@ Item {
property alias contentLoader: contentLoader property alias contentLoader: contentLoader
property Component overlayContent: null property Component overlayContent: null
property alias overlayLoader: overlayLoader property alias overlayLoader: overlayLoader
readonly property alias backgroundWindow: contentWindow
property real popupWidth: 400 property real popupWidth: 400
property real popupHeight: 300 property real popupHeight: 300
property real triggerX: 0 property real triggerX: 0
@@ -222,8 +223,6 @@ Item {
readonly property real contentAnimX: contentContainer.animX readonly property real contentAnimX: contentContainer.animX
readonly property real contentAnimY: contentContainer.animY readonly property real contentAnimY: contentContainer.animY
property bool _fullSyncPending: false
// ─── ConnectedModeState sync ──────────────────────────────────────────── // ─── ConnectedModeState sync ────────────────────────────────────────────
function _syncPopoutChromeState() { function _syncPopoutChromeState() {
if (!root.frameOwnsConnectedChrome) { if (!root.frameOwnsConnectedChrome) {
@@ -262,20 +261,8 @@ Item {
ConnectedModeState.setPopoutBody(_chromeClaimId, root.alignedX, root.renderedAlignedY, root.alignedWidth, root.renderedAlignedHeight); ConnectedModeState.setPopoutBody(_chromeClaimId, root.alignedX, root.renderedAlignedY, root.alignedWidth, root.renderedAlignedHeight);
} }
function _flushFullSync() {
_fullSyncPending = false;
if (root && typeof root._syncPopoutChromeState === "function")
root._syncPopoutChromeState();
}
function _queueFullSync() { function _queueFullSync() {
if (_fullSyncPending) _syncPopoutChromeState();
return;
_fullSyncPending = true;
Qt.callLater(() => {
if (root && typeof root._flushFullSync === "function")
root._flushFullSync();
});
} }
onAlignedXChanged: _queueFullSync() onAlignedXChanged: _queueFullSync()
@@ -349,7 +336,6 @@ Item {
contentWindow.visible = true; contentWindow.visible = true;
Qt.callLater(() => {
animationsEnabled = true; animationsEnabled = true;
shouldBeVisible = true; shouldBeVisible = true;
if (shouldBeVisible && screen) { if (shouldBeVisible && screen) {
@@ -357,7 +343,6 @@ Item {
PopoutManager.showPopout(popoutHandle); PopoutManager.showPopout(popoutHandle);
opened(); opened();
} }
});
} }
function close() { function close() {

View File

@@ -13,6 +13,7 @@ Item {
property alias contentLoader: contentLoader property alias contentLoader: contentLoader
property Component overlayContent: null property Component overlayContent: null
property alias overlayLoader: overlayLoader property alias overlayLoader: overlayLoader
readonly property alias backgroundWindow: backgroundWindow
property real popupWidth: 400 property real popupWidth: 400
property real popupHeight: 300 property real popupHeight: 300
property real triggerX: 0 property real triggerX: 0
@@ -181,7 +182,6 @@ Item {
_surfaceMarginLeft = alignedX - shadowBuffer; _surfaceMarginLeft = alignedX - shadowBuffer;
_surfaceW = alignedWidth + shadowBuffer * 2; _surfaceW = alignedWidth + shadowBuffer * 2;
} }
Qt.callLater(() => {
if (shouldBeVisible && screen) { if (shouldBeVisible && screen) {
if (useBackgroundWindow) if (useBackgroundWindow)
backgroundWindow.visible = true; backgroundWindow.visible = true;
@@ -189,7 +189,6 @@ Item {
PopoutManager.showPopout(popoutHandle); PopoutManager.showPopout(popoutHandle);
opened(); opened();
} }
});
} }
function close() { function close() {

View File

@@ -55,7 +55,7 @@ Item {
} }
Connections { Connections {
target: root.targetWindow target: root.targetWindow ?? null
function onVisibleChanged() { function onVisibleChanged() {
if (root.targetWindow && root.targetWindow.visible) { if (root.targetWindow && root.targetWindow.visible) {
root._region = null; root._region = null;