This commit is contained in:
Zacharias-Brohn
2026-02-14 18:20:28 +01:00
parent 4286122a97
commit c5b769b6e0
6 changed files with 36 additions and 11 deletions
+18 -3
View File
@@ -25,6 +25,7 @@ Variants {
color: "transparent" color: "transparent"
property var root: Quickshell.shellDir property var root: Quickshell.shellDir
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.namespace: "ZShell-Bar" WlrLayershell.namespace: "ZShell-Bar"
WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.exclusionMode: ExclusionMode.Ignore
@@ -33,6 +34,7 @@ Variants {
WlrLayershell.namespace: "ZShell-Bar-Exclusion" WlrLayershell.namespace: "ZShell-Bar-Exclusion"
screen: bar.screen screen: bar.screen
WlrLayershell.layer: WlrLayer.Bottom WlrLayershell.layer: WlrLayer.Bottom
WlrLayershell.exclusionMode: Config.autoHide && !visibilities.bar ? ExclusionMode.Ignore : ExclusionMode.Auto
anchors { anchors {
left: true left: true
right: true right: true
@@ -50,8 +52,9 @@ Variants {
} }
mask: Region { mask: Region {
id: region
x: 0 x: 0
y: 34 y: !visibilities.bar ? 4 : 34
property list<Region> nullRegions: [] property list<Region> nullRegions: []
property bool hcurrent: ( panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu") ) || visibilities.sidebar || visibilities.dashboard property bool hcurrent: ( panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu") ) || visibilities.sidebar || visibilities.dashboard
@@ -92,6 +95,7 @@ Variants {
property bool sidebar property bool sidebar
property bool dashboard property bool dashboard
property bool bar
Component.onCompleted: Visibilities.load(scope.modelData, this) Component.onCompleted: Visibilities.load(scope.modelData, this)
} }
@@ -108,26 +112,32 @@ Variants {
Border { Border {
bar: backgroundRect bar: backgroundRect
visibilities: visibilities
} }
Backgrounds { Backgrounds {
visibilities: visibilities
panels: panels panels: panels
bar: backgroundRect bar: backgroundRect
} }
} }
MouseArea { MouseArea {
id: mouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onContainsMouseChanged: { onContainsMouseChanged: {
if ( !containsMouse ) { if ( !containsMouse ) {
panels.popouts.hasCurrent = false; panels.popouts.hasCurrent = false;
if ( !visibilities.sidebar && !visibilities.dashboard )
visibilities.bar = Config.autoHide ? false : true;
} }
} }
onPositionChanged: event => { onPositionChanged: event => {
if ( mouseY < backgroundRect.implicitHeight ) { if ( !visibilities.bar ? mouseY < 4 : mouseY < backgroundRect.implicitHeight ) {
visibilities.bar = true;
barLoader.checkPopout(mouseX); barLoader.checkPopout(mouseX);
} }
} }
@@ -161,10 +171,11 @@ Variants {
Rectangle { Rectangle {
id: backgroundRect id: backgroundRect
property Wrapper popouts: panels.popouts property Wrapper popouts: panels.popouts
anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top
implicitHeight: 34 implicitHeight: 34
anchors.topMargin: Config.autoHide && !visibilities.bar ? -30 : 0
color: "transparent" color: "transparent"
radius: 0 radius: 0
@@ -172,6 +183,10 @@ Variants {
CAnim {} CAnim {}
} }
Behavior on anchors.topMargin {
Anim {}
}
BarLoader { BarLoader {
id: barLoader id: barLoader
anchors.fill: parent anchors.fill: parent
+2
View File
@@ -32,6 +32,7 @@ Singleton {
property alias general: adapter.general property alias general: adapter.general
property alias dashboard: adapter.dashboard property alias dashboard: adapter.dashboard
property alias appearance: adapter.appearance property alias appearance: adapter.appearance
property alias autoHide: adapter.autoHide
FileView { FileView {
id: root id: root
@@ -72,6 +73,7 @@ Singleton {
property General general: General {} property General general: General {}
property DashboardConfig dashboard: DashboardConfig {} property DashboardConfig dashboard: DashboardConfig {}
property AppearanceConf appearance: AppearanceConf {} property AppearanceConf appearance: AppearanceConf {}
property bool autoHide: false
} }
} }
} }
+3 -1
View File
@@ -1,3 +1,4 @@
import Quickshell
import QtQuick import QtQuick
import QtQuick.Shapes import QtQuick.Shapes
import qs.Modules as Modules import qs.Modules as Modules
@@ -11,10 +12,11 @@ Shape {
required property Panels panels required property Panels panels
required property Item bar required property Item bar
required property PersistentProperties visibilities
anchors.fill: parent anchors.fill: parent
// anchors.margins: 8 // anchors.margins: 8
anchors.topMargin: bar.implicitHeight anchors.topMargin: !root.visibilities.bar ? 4 : bar.implicitHeight
preferredRendererType: Shape.CurveRenderer preferredRendererType: Shape.CurveRenderer
Modules.Background { Modules.Background {
+3 -2
View File
@@ -23,9 +23,10 @@ RowLayout {
required property ShellScreen screen required property ShellScreen screen
function checkPopout(x: real): void { function checkPopout(x: real): void {
const ch = childAt(x, height / 2) as WrappedLoader; const ch = childAt(x, 2) as WrappedLoader;
if (!ch && !popouts.currentName.includes("traymenu")) { if (!ch) {
if ( !popouts.currentName.includes("traymenu") )
popouts.hasCurrent = false; popouts.hasCurrent = false;
return; return;
} }
+7 -2
View File
@@ -1,5 +1,6 @@
pragma ComponentBehavior: Bound pragma ComponentBehavior: Bound
import Quickshell
import QtQuick import QtQuick
import QtQuick.Effects import QtQuick.Effects
import qs.Modules import qs.Modules
@@ -10,12 +11,13 @@ Item {
id: root id: root
required property Item bar required property Item bar
required property PersistentProperties visibilities
anchors.fill: parent anchors.fill: parent
CustomRect { CustomRect {
anchors.fill: parent anchors.fill: parent
color: DynamicColors.palette.m3surface color: Config.autoHide && !root.visibilities.bar ? "transparent" : DynamicColors.palette.m3surface
layer.enabled: true layer.enabled: true
@@ -36,9 +38,12 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: root.bar.implicitHeight anchors.topMargin: Config.autoHide && !root.visibilities.bar ? 4 : root.bar.implicitHeight
topLeftRadius: 8 topLeftRadius: 8
topRightRadius: 8 topRightRadius: 8
Behavior on anchors.topMargin {
Anim {}
}
} }
} }
} }
+2 -2
View File
@@ -16,8 +16,8 @@ Item {
CustomRect { CustomRect {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 3 anchors.topMargin: 4
anchors.bottomMargin: 3 anchors.bottomMargin: 4
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
radius: 1000 radius: 1000
} }