diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/Shortcuts.qml | 9 | ||||
| -rw-r--r-- | modules/background/Wallpaper.qml | 14 | ||||
| -rw-r--r-- | modules/dashboard/dash/User.qml | 4 | ||||
| -rw-r--r-- | modules/drawers/Interactions.qml | 86 |
4 files changed, 95 insertions, 18 deletions
diff --git a/modules/Shortcuts.qml b/modules/Shortcuts.qml index bed620c..3d665ff 100644 --- a/modules/Shortcuts.qml +++ b/modules/Shortcuts.qml @@ -9,6 +9,15 @@ Scope { property bool launcherInterrupted CustomShortcut { + name: "showall" + description: "Toggle launcher, dashboard and osd" + onPressed: { + const v = Visibilities.getForActive(); + v.launcher = v.dashboard = v.osd = !(v.launcher || v.dashboard || v.osd); + } + } + + CustomShortcut { name: "session" description: "Toggle session menu" onPressed: { diff --git a/modules/background/Wallpaper.qml b/modules/background/Wallpaper.qml index 2734034..f4e3243 100644 --- a/modules/background/Wallpaper.qml +++ b/modules/background/Wallpaper.qml @@ -8,7 +8,7 @@ import QtQuick Item { id: root - property url source: Wallpapers.current ? `file://${Wallpapers.current}` : "" + property string source: Wallpapers.current property Image current: one anchors.fill: parent @@ -32,20 +32,14 @@ Item { id: img function update(): void { - const srcPath = `${root.source}`.slice(7); - if (thumbnail.originalPath === srcPath) { + if (path === root.source) root.current = this; - } else - path = srcPath; + else + path = root.source; } anchors.fill: parent - loadOriginal: true - asynchronous: true - cache: false - fillMode: Image.PreserveAspectCrop - opacity: 0 scale: Wallpapers.showPreview ? 1 : 0.8 diff --git a/modules/dashboard/dash/User.qml b/modules/dashboard/dash/User.qml index c7d2bfd..f1b9b18 100644 --- a/modules/dashboard/dash/User.qml +++ b/modules/dashboard/dash/User.qml @@ -10,13 +10,13 @@ Row { id: root padding: Appearance.padding.large - spacing: Appearance.spacing.large + spacing: Appearance.spacing.normal StyledClippingRect { implicitWidth: info.implicitHeight implicitHeight: info.implicitHeight - radius: Appearance.rounding.full + radius: Appearance.rounding.large color: Colours.palette.m3surfaceContainerHigh MaterialIcon { diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index 3ec522b..10e37a8 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -16,6 +16,8 @@ MouseArea { property bool osdHovered property point dragStart + property bool dashboardShortcutActive + property bool osdShortcutActive function withinPanelHeight(panel: Item, x: real, y: real): bool { const panelY = BorderConfig.thickness + panel.y; @@ -37,9 +39,14 @@ MouseArea { onPressed: event => dragStart = Qt.point(event.x, event.y) onContainsMouseChanged: { if (!containsMouse) { - visibilities.osd = false; - osdHovered = false; - visibilities.dashboard = false; + // Only hide if not activated by shortcut + if (!osdShortcutActive) { + visibilities.osd = false; + osdHovered = false; + } + if (!dashboardShortcutActive) { + visibilities.dashboard = false; + } popouts.hasCurrent = false; } } @@ -47,8 +54,16 @@ MouseArea { onPositionChanged: ({x, y}) => { // Show osd on hover const showOsd = inRightPanel(panels.osd, x, y); - visibilities.osd = showOsd; - osdHovered = showOsd; + + // Always update visibility based on hover if not in shortcut mode + if (!osdShortcutActive) { + visibilities.osd = showOsd; + osdHovered = showOsd; + } else if (showOsd) { + // If hovering over OSD area while in shortcut mode, transition to hover control + osdShortcutActive = false; + osdHovered = true; + } // Show/hide session on drag if (pressed && withinPanelHeight(panels.session, x, y)) { @@ -60,7 +75,15 @@ MouseArea { } // Show dashboard on hover - visibilities.dashboard = inTopPanel(panels.dashboard, x, y); + const showDashboard = inTopPanel(panels.dashboard, x, y); + + // Always update visibility based on hover if not in shortcut mode + if (!dashboardShortcutActive) { + visibilities.dashboard = showDashboard; + } else if (showDashboard) { + // If hovering over dashboard area while in shortcut mode, transition to hover control + dashboardShortcutActive = false; + } // Show popouts on hover const popout = panels.popouts; @@ -75,6 +98,57 @@ MouseArea { popouts.hasCurrent = false; } + // Monitor individual visibility changes + Connections { + target: root.visibilities + + function onLauncherChanged() { + // If launcher is hidden, clear shortcut flags for dashboard and OSD + if (!root.visibilities.launcher) { + root.dashboardShortcutActive = false; + root.osdShortcutActive = false; + + // Also hide dashboard and OSD if they're not being hovered + const inDashboardArea = root.inTopPanel(root.panels.dashboard, root.mouseX, root.mouseY); + const inOsdArea = root.inRightPanel(root.panels.osd, root.mouseX, root.mouseY); + + if (!inDashboardArea) { + root.visibilities.dashboard = false; + } + if (!inOsdArea) { + root.visibilities.osd = false; + root.osdHovered = false; + } + } + } + + function onDashboardChanged() { + if (root.visibilities.dashboard) { + // Dashboard became visible, immediately check if this should be shortcut mode + const inDashboardArea = root.inTopPanel(root.panels.dashboard, root.mouseX, root.mouseY); + if (!inDashboardArea) { + root.dashboardShortcutActive = true; + } + } else { + // Dashboard hidden, clear shortcut flag + root.dashboardShortcutActive = false; + } + } + + function onOsdChanged() { + if (root.visibilities.osd) { + // OSD became visible, immediately check if this should be shortcut mode + const inOsdArea = root.inRightPanel(root.panels.osd, root.mouseX, root.mouseY); + if (!inOsdArea) { + root.osdShortcutActive = true; + } + } else { + // OSD hidden, clear shortcut flag + root.osdShortcutActive = false; + } + } + } + Osd.Interactions { screen: root.screen visibilities: root.visibilities |