mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-30 09:32:05 -04:00
Sync up Frame w/Master branch updates
This commit is contained in:
@@ -161,37 +161,36 @@ Item {
|
||||
}
|
||||
|
||||
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 {
|
||||
const bar = root.getPreferredBar("clockButtonRef");
|
||||
if (!bar)
|
||||
return "DASH_OPEN_FAILED";
|
||||
|
||||
const tabIndex = resolveTabIndex(tab);
|
||||
const dash = root.dankDashPopoutLoader.item;
|
||||
const onSameScreen = dash && dash.shouldBeVisible && dash.triggerScreen?.name === bar.screen?.name;
|
||||
|
||||
if (!onSameScreen) {
|
||||
bar.triggerWallpaperBrowser();
|
||||
if (dash && dash.shouldBeVisible && dash.triggerScreen?.name === bar.screen?.name) {
|
||||
dash.currentTabIndex = tabIndex;
|
||||
if (dash.updateSurfacePosition)
|
||||
dash.updateSurfacePosition();
|
||||
return "DASH_OPEN_SUCCESS";
|
||||
}
|
||||
|
||||
if (!root.dankDashPopoutLoader.item)
|
||||
if (!bar.triggerDashTab(tabIndex))
|
||||
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";
|
||||
}
|
||||
|
||||
@@ -211,23 +210,8 @@ Item {
|
||||
|
||||
const bar = root.getPreferredBar("clockButtonRef");
|
||||
if (bar) {
|
||||
bar.triggerWallpaperBrowser();
|
||||
if (root.dankDashPopoutLoader.item) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (!bar.triggerDashTab(resolveTabIndex(tab)))
|
||||
return "DASH_TOGGLE_FAILED";
|
||||
return "DASH_TOGGLE_SUCCESS";
|
||||
}
|
||||
return "DASH_TOGGLE_FAILED";
|
||||
|
||||
@@ -286,7 +286,11 @@ DankPopout {
|
||||
id: editControls
|
||||
width: parent.width
|
||||
visible: editMode
|
||||
popoutContent: controlContent
|
||||
popupScreen: root.screen
|
||||
popoutX: root.alignedX
|
||||
popoutY: root.alignedY
|
||||
popoutWidth: root.alignedWidth
|
||||
popoutHeight: root.alignedHeight
|
||||
availableWidgets: {
|
||||
if (!editMode)
|
||||
return [];
|
||||
|
||||
@@ -42,10 +42,10 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
function triggerWallpaperBrowser() {
|
||||
function triggerDashTab(tabIndex) {
|
||||
dankDashPopoutLoader.active = true;
|
||||
if (!dankDashPopoutLoader.item) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
let section = "center";
|
||||
@@ -81,7 +81,12 @@ PanelWindow {
|
||||
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: {
|
||||
|
||||
@@ -1412,6 +1412,10 @@ Item {
|
||||
property: "value"
|
||||
value: selectedBarConfig?.widgetOutlineThickness ?? 1
|
||||
restoreMode: Binding.RestoreBinding
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
visible: dankBarTab.connectedFrameModeActive
|
||||
width: parent.width
|
||||
|
||||
@@ -46,6 +46,7 @@ Item {
|
||||
|
||||
readonly property var contentLoader: impl.item ? impl.item.contentLoader : _fallbackContentLoader
|
||||
readonly property var overlayLoader: impl.item ? impl.item.overlayLoader : _fallbackOverlayLoader
|
||||
readonly property var backgroundWindow: impl.item ? impl.item.backgroundWindow : null
|
||||
|
||||
Loader {
|
||||
id: _fallbackContentLoader
|
||||
|
||||
@@ -14,6 +14,7 @@ Item {
|
||||
property alias contentLoader: contentLoader
|
||||
property Component overlayContent: null
|
||||
property alias overlayLoader: overlayLoader
|
||||
readonly property alias backgroundWindow: contentWindow
|
||||
property real popupWidth: 400
|
||||
property real popupHeight: 300
|
||||
property real triggerX: 0
|
||||
@@ -222,8 +223,6 @@ Item {
|
||||
readonly property real contentAnimX: contentContainer.animX
|
||||
readonly property real contentAnimY: contentContainer.animY
|
||||
|
||||
property bool _fullSyncPending: false
|
||||
|
||||
// ─── ConnectedModeState sync ────────────────────────────────────────────
|
||||
function _syncPopoutChromeState() {
|
||||
if (!root.frameOwnsConnectedChrome) {
|
||||
@@ -262,20 +261,8 @@ Item {
|
||||
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() {
|
||||
if (_fullSyncPending)
|
||||
return;
|
||||
_fullSyncPending = true;
|
||||
Qt.callLater(() => {
|
||||
if (root && typeof root._flushFullSync === "function")
|
||||
root._flushFullSync();
|
||||
});
|
||||
_syncPopoutChromeState();
|
||||
}
|
||||
|
||||
onAlignedXChanged: _queueFullSync()
|
||||
@@ -349,7 +336,6 @@ Item {
|
||||
|
||||
contentWindow.visible = true;
|
||||
|
||||
Qt.callLater(() => {
|
||||
animationsEnabled = true;
|
||||
shouldBeVisible = true;
|
||||
if (shouldBeVisible && screen) {
|
||||
@@ -357,7 +343,6 @@ Item {
|
||||
PopoutManager.showPopout(popoutHandle);
|
||||
opened();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function close() {
|
||||
|
||||
@@ -13,6 +13,7 @@ Item {
|
||||
property alias contentLoader: contentLoader
|
||||
property Component overlayContent: null
|
||||
property alias overlayLoader: overlayLoader
|
||||
readonly property alias backgroundWindow: backgroundWindow
|
||||
property real popupWidth: 400
|
||||
property real popupHeight: 300
|
||||
property real triggerX: 0
|
||||
@@ -181,7 +182,6 @@ Item {
|
||||
_surfaceMarginLeft = alignedX - shadowBuffer;
|
||||
_surfaceW = alignedWidth + shadowBuffer * 2;
|
||||
}
|
||||
Qt.callLater(() => {
|
||||
if (shouldBeVisible && screen) {
|
||||
if (useBackgroundWindow)
|
||||
backgroundWindow.visible = true;
|
||||
@@ -189,7 +189,6 @@ Item {
|
||||
PopoutManager.showPopout(popoutHandle);
|
||||
opened();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function close() {
|
||||
|
||||
@@ -55,7 +55,7 @@ Item {
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.targetWindow
|
||||
target: root.targetWindow ?? null
|
||||
function onVisibleChanged() {
|
||||
if (root.targetWindow && root.targetWindow.visible) {
|
||||
root._region = null;
|
||||
|
||||
Reference in New Issue
Block a user