From 439a14d29e1774a855967247cc05634e153edfba Mon Sep 17 00:00:00 2001 From: zach Date: Wed, 12 Aug 2026 01:35:23 +0200 Subject: [PATCH] Initial commit implementing reveal on hover in fullscreen --- Config/BarConfig.qml | 2 ++ Drawers/Exclusions.qml | 4 ++++ Drawers/Interactions.qml | 18 ++++++++++++++++- Drawers/Regions.qml | 2 +- Drawers/Windows.qml | 9 +++++++-- Modules/Bar/Bar.qml | 19 +++++++++--------- Modules/Bar/BarLoader.qml | 3 ++- Modules/Settings/Pages/Panels/BarPanel.qml | 23 +++++++++++++++++++++- 8 files changed, 65 insertions(+), 15 deletions(-) diff --git a/Config/BarConfig.qml b/Config/BarConfig.qml index 4f3697f..2395ee6 100644 --- a/Config/BarConfig.qml +++ b/Config/BarConfig.qml @@ -57,10 +57,12 @@ JsonObject { enabled: true }, ] + property bool fullscreenReveal: true property int height: 34 property bool hideWhenNotif: false property Popouts popouts: Popouts { } + property int revealDelay: 300 property int rounding: 8 property int smoothing: 32 property Tray tray: Tray { diff --git a/Drawers/Exclusions.qml b/Drawers/Exclusions.qml index 3373e34..00cdd10 100644 --- a/Drawers/Exclusions.qml +++ b/Drawers/Exclusions.qml @@ -1,6 +1,7 @@ pragma ComponentBehavior: Bound import Quickshell +import Quickshell.Wayland import QtQuick import qs.Config import qs.Components @@ -14,6 +15,9 @@ Scope { ExclusionZone { id: top + WlrLayershell.layer: WlrLayer.Overlay + anchors.left: true + anchors.right: true anchors.top: true exclusiveZone: root.bar.exclusiveZone } diff --git a/Drawers/Interactions.qml b/Drawers/Interactions.qml index c72f55f..39a63c4 100644 --- a/Drawers/Interactions.qml +++ b/Drawers/Interactions.qml @@ -158,6 +158,19 @@ Item { } } + Timer { + id: unhideTimer + + interval: Config.bar.revealDelay + repeat: false + running: false + + onTriggered: { + if (hoverHandler.hovered) + root.bar.isHovered = true; + } + } + HoverHandler { id: hoverHandler @@ -174,7 +187,7 @@ Item { root.popouts.hasCurrent = false; } - if (Config.bar.autoHide) + if (Config.bar.autoHide || root.bar.fullscreen) root.bar.isHovered = false; } } @@ -196,6 +209,9 @@ Item { if (!root.visibilities.bar && Config.bar.autoHide && y < root.bar.implicitHeight) root.bar.isHovered = true; + if (root.bar.fullscreen && !root.bar.isHovered) + unhideTimer.start(); + if (root.panels.sidebar.offsetScale === 1) { const showOsd = root.inRightPanel(root.panels.osdWrapper, x, y); diff --git a/Drawers/Regions.qml b/Drawers/Regions.qml index e5c3757..decebf9 100644 --- a/Drawers/Regions.qml +++ b/Drawers/Regions.qml @@ -17,7 +17,7 @@ Region { intersection: Intersection.Xor width: win.width - win.borderThickness * 2 - win.dragMaskPadding * 2 x: win.borderThickness + win.dragMaskPadding - y: bar.implicitHeight + win.dragMaskPadding + y: bar.implicitHeight + win.dragMaskPadding + (bar.fullscreen ? 1 : 0) R { panel: root.panels.dashboardWrapper diff --git a/Drawers/Windows.qml b/Drawers/Windows.qml index 23f9028..fa53995 100644 --- a/Drawers/Windows.qml +++ b/Drawers/Windows.qml @@ -49,7 +49,7 @@ CustomWindow { readonly property HyprlandMonitor monitor: Hypr.monitorFor(screen) property var root: Quickshell.shellDir readonly property real sdfBorderOffset: 2 * fsTransitionProg - readonly property real shadowOpacity: 0.7 * (1 - fsTransitionProg) + readonly property real shadowOpacity: 0.7 * (1 - (bar.isHovered ? 0 : fsTransitionProg)) property color surfaceColor: DynamicColors.tPalette.m3surface WlrLayershell.exclusionMode: ExclusionMode.Ignore @@ -57,7 +57,7 @@ CustomWindow { WlrLayershell.layer: (fsTransitionProg > 0 && Config.general.showOverFullscreen) || (hasSpecialWorkspace && hasFullscreenOnNormalWs) ? WlrLayer.Overlay : WlrLayer.Top color: "transparent" contentItem.focus: true - mask: visibilities.isDrawing ? null : (hasFullscreen ? emptyRegion : regions) + mask: visibilities.isDrawing ? null : (hasFullscreen && !bar.isHovered ? emptyRegion : regions) name: "Bar" Behavior on fsTransitionProg { @@ -108,6 +108,11 @@ CustomWindow { x: root.width - width y: panels.osdWrapper.y + bar.implicitHeight } + + Region { + height: 1 + width: root.screen.width + } } Regions { diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index b2a1842..274cc9f 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -13,6 +13,7 @@ RowLayout { id: root required property bool fullscreen + required property bool isHovered required property Wrapper popouts required property ClipWrapper popoutsWrapper required property ShellScreen screen @@ -85,7 +86,7 @@ RowLayout { delegate: EntryWrapper { HyprsunsetWidget { - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } @@ -104,7 +105,7 @@ RowLayout { delegate: EntryWrapper { Workspaces { screen: root.screen - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } @@ -116,7 +117,7 @@ RowLayout { TrayIcons { loader: root popouts: root.popouts - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } @@ -136,7 +137,7 @@ RowLayout { delegate: EntryWrapper { Resources { visibilities: root.visibilities - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } @@ -146,7 +147,7 @@ RowLayout { delegate: EntryWrapper { UpdatesWidget { - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } @@ -158,7 +159,7 @@ RowLayout { NotifBell { popouts: root.popouts visibilities: root.visibilities - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } @@ -171,7 +172,7 @@ RowLayout { loader: root popouts: root.popouts visibilities: root.visibilities - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } @@ -182,7 +183,7 @@ RowLayout { delegate: EntryWrapper { WindowTitle { bar: root - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } @@ -201,7 +202,7 @@ RowLayout { delegate: EntryWrapper { MediaWidget { - visible: !root.fullscreen + visible: !root.fullscreen || root.isHovered } } } diff --git a/Modules/Bar/BarLoader.qml b/Modules/Bar/BarLoader.qml index f5baba8..d850e53 100644 --- a/Modules/Bar/BarLoader.qml +++ b/Modules/Bar/BarLoader.qml @@ -23,7 +23,7 @@ Item { required property Wrapper popouts required property ClipWrapper popoutsWrapper required property ShellScreen screen - readonly property bool shouldBeVisible: !fullscreen && (!Config.bar.autoHide || visibilities.bar || isHovered) + readonly property bool shouldBeVisible: (!fullscreen && (!Config.bar.autoHide || visibilities.bar)) || isHovered readonly property int vPadding: 6 required property PersistentProperties visibilities @@ -78,6 +78,7 @@ Item { sourceComponent: Bar { fullscreen: root.fullscreen height: root.contentHeight + isHovered: root.isHovered popouts: root.popouts popoutsWrapper: root.popoutsWrapper screen: root.screen diff --git a/Modules/Settings/Pages/Panels/BarPanel.qml b/Modules/Settings/Pages/Panels/BarPanel.qml index 9b344eb..be8b637 100644 --- a/Modules/Settings/Pages/Panels/BarPanel.qml +++ b/Modules/Settings/Pages/Panels/BarPanel.qml @@ -25,7 +25,6 @@ PageBase { ToggleRow { checked: Config.bar.autoHide first: true - last: true settingAnchor: "bar-autohide" subtext: qsTr("Hide the bar, reveal on hover") text: qsTr("Auto hide") @@ -33,6 +32,28 @@ PageBase { onToggled: Config.bar.autoHide = checked } + ToggleRow { + checked: Config.bar.fullscreenReveal + settingAnchor: "bar-fullscreen-reveal" + subtext: qsTr("Hover top edge to show bar in fullscreen") + text: qsTr("Reveal on edge") + + onToggled: Config.bar.fullscreenReveal = checked + } + + SpinRow { + from: 0 + last: true + settingAnchor: "bar-reveal-delay" + stepSize: 100 + subtext: qsTr("The delay before bar is revealed when cursor is at edge") + text: qsTr("Reveal delay") + to: 2000 + value: Config.bar.revealDelay + + onMoved: v => Config.bar.revealDelay = v + } + // Components SectionHeader { text: qsTr("Components")