diff --git a/Common/SettingsData.qml b/Common/SettingsData.qml index 03898718..8cec8393 100644 --- a/Common/SettingsData.qml +++ b/Common/SettingsData.qml @@ -965,7 +965,7 @@ Singleton { } return { "x": relativeX, - "y": barThickness + dankBarSpacing + dankBarBottomGap + Theme.popupDistance, + "y": barThickness + dankBarSpacing + Theme.popupDistance, "width": widgetWidth } } diff --git a/DMSShellIPC.qml b/DMSShellIPC.qml index 33554cb4..4fda0d09 100644 --- a/DMSShellIPC.qml +++ b/DMSShellIPC.qml @@ -135,24 +135,22 @@ Item { } function toggle(tab: string): string { - root.dankDashPopoutLoader.active = true - if (root.dankDashPopoutLoader.item) { - if (root.dankDashPopoutLoader.item.dashVisible) { - root.dankDashPopoutLoader.item.dashVisible = false - } else { + if (root.dankBarLoader.item && root.dankBarLoader.item.triggerWallpaperBrowserOnFocusedScreen()) { + 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 ? 2 : 0 + root.dankDashPopoutLoader.item.currentTabIndex = SettingsData.weatherEnabled ? 3 : 0 break default: root.dankDashPopoutLoader.item.currentTabIndex = 0 break } - root.dankDashPopoutLoader.item.setTriggerPosition(Screen.width / 2, Theme.barHeight + Theme.spacingS, 100, "center", Screen) - root.dankDashPopoutLoader.item.dashVisible = true } return "DASH_TOGGLE_SUCCESS" } diff --git a/Modules/DankBar/DankBar.qml b/Modules/DankBar/DankBar.qml index 8ca5a1e3..286f4c5c 100644 --- a/Modules/DankBar/DankBar.qml +++ b/Modules/DankBar/DankBar.qml @@ -110,9 +110,9 @@ Item { return } - if (clockButtonRef && dankDashPopoutLoader.item.setTriggerPosition) { - const globalPos = clockButtonRef.mapToGlobal(0, 0) - const pos = SettingsData.getPopupTriggerPosition(globalPos, barWindow.screen, barWindow.effectiveBarThickness, clockButtonRef.width) + if (clockButtonRef && clockButtonRef.visualContent && dankDashPopoutLoader.item.setTriggerPosition) { + const globalPos = clockButtonRef.visualContent.mapToGlobal(0, 0) + const pos = SettingsData.getPopupTriggerPosition(globalPos, barWindow.screen, barWindow.effectiveBarThickness, clockButtonRef.visualWidth) const section = clockButtonRef.section || "center" dankDashPopoutLoader.item.setTriggerPosition(pos.x, pos.y, pos.width, section, barWindow.screen) } else { diff --git a/docs/IPC.md b/docs/IPC.md index 68a284e8..b35d38d2 100644 --- a/docs/IPC.md +++ b/docs/IPC.md @@ -508,12 +508,12 @@ Dashboard popup control with tab selection for overview, media, and weather info **Functions:** - `open [tab]` - Show dashboard popup with optional tab selection - - Parameters: `tab` - Optional tab to open: "" (default), "overview", "media", or "weather" + - Parameters: `tab` - Tab to open: "", "overview", "media", or "weather" - Returns: Success/failure message - `close` - Hide dashboard popup - Returns: Success/failure message - `toggle [tab]` - Toggle dashboard popup visibility with optional tab selection - - Parameters: `tab` - Optional tab to open when showing: "" (default), "overview", "media", or "weather" + - Parameters: `tab` - Tab to open when showing: "", "overview", "media", or "weather" - Returns: Success/failure message ### Target: `dankdash`