Feat: Reveal bar on hover in fullscreen #149

Merged
zach merged 5 commits from feat/fullscreen-reveal-bar into main 2026-08-16 23:24:37 +02:00
6 changed files with 64 additions and 14 deletions
+4
View File
@@ -1,6 +1,7 @@
pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Wayland
import QtQuick
import ZShell.Config
import qs.Components
@@ -15,6 +16,9 @@ Scope {
ExclusionZone {
id: top
WlrLayershell.layer: WlrLayer.Overlay
anchors.left: true
anchors.right: true
anchors.top: true
hasBar: root.geometry.barOnTop
}
+17 -1
View File
@@ -162,6 +162,19 @@ Item {
}
}
Timer {
id: unhideTimer
interval: Config.bar.revealDelay
repeat: false
running: false
onTriggered: {
if (hoverHandler.hovered)
root.bar.isHovered = true;
}
}
HoverHandler {
id: hoverHandler
@@ -178,7 +191,7 @@ Item {
root.popouts.hasCurrent = false;
}
if (Config.bar.autoHide)
if (Config.bar.autoHide || root.bar.fullscreen)
root.bar.isHovered = false;
}
}
@@ -200,6 +213,9 @@ Item {
if (!root.visibilities.bar && Config.bar.autoHide && root.geometry.barContains(x, y, true))
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);
+8 -2
View File
@@ -51,7 +51,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: Colors.tPalette.m3surface
WlrLayershell.exclusionMode: ExclusionMode.Ignore
@@ -59,7 +59,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 {
@@ -118,6 +118,12 @@ CustomWindow {
x: root.width - width
y: panels.osdWrapper.y + bar.implicitHeight
}
Region {
height: geometry.horizontal ? 1 : root.screen.height
width: geometry.horizontal ? root.screen.width : 1
y: geometry.position === "bottom" ? root.screen.height - 1 : 0
}
}
Regions {
+10 -9
View File
@@ -12,6 +12,7 @@ GridLayout {
required property bool fullscreen
required property bool horizontal
required property bool isHovered
required property Wrapper popouts
required property ClipWrapper popoutsWrapper
required property ShellScreen screen
@@ -92,7 +93,7 @@ GridLayout {
delegate: EntryWrapper {
HyprsunsetWidget {
horizontal: root.horizontal
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
@@ -113,7 +114,7 @@ GridLayout {
Workspaces {
horizontal: root.horizontal
screen: root.screen
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
@@ -126,7 +127,7 @@ GridLayout {
horizontal: root.horizontal
loader: root
popouts: root.popouts
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
@@ -148,7 +149,7 @@ GridLayout {
Resources {
horizontal: root.horizontal
visibilities: root.visibilities
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
@@ -159,7 +160,7 @@ GridLayout {
delegate: EntryWrapper {
UpdatesWidget {
horizontal: root.horizontal
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
@@ -172,7 +173,7 @@ GridLayout {
horizontal: root.horizontal
popouts: root.popouts
visibilities: root.visibilities
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
@@ -186,7 +187,7 @@ GridLayout {
loader: root
popouts: root.popouts
visibilities: root.visibilities
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
@@ -198,7 +199,7 @@ GridLayout {
WindowTitle {
bar: root
horizontal: root.horizontal
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
@@ -218,7 +219,7 @@ GridLayout {
delegate: EntryWrapper {
MediaWidget {
horizontal: root.horizontal
visible: !root.fullscreen
visible: !root.fullscreen || root.isHovered
}
}
}
+3 -1
View File
@@ -21,7 +21,7 @@ Item {
required property ClipWrapper popoutsWrapper
required property string position
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
@@ -79,7 +79,9 @@ Item {
sourceComponent: Bar {
fullscreen: root.fullscreen
height: root.contentHeight
horizontal: root.horizontal
isHovered: root.isHovered
popouts: root.popouts
popoutsWrapper: root.popoutsWrapper
screen: root.screen
+22 -1
View File
@@ -35,7 +35,6 @@ PageBase {
SelectRow {
active: Config.bar.position === "top" ? menuItems[0] : Config.bar.position === "left" ? menuItems[1] : menuItems[2]
last: true
settingAnchor: "bar-position"
subtext: qsTr("Change which edge the bar appears on")
text: qsTr("Position")
@@ -61,6 +60,28 @@ PageBase {
onSelected: item => Config.bar.position = item.value
}
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")