autohide
This commit is contained in:
@@ -25,6 +25,7 @@ Variants {
|
||||
color: "transparent"
|
||||
property var root: Quickshell.shellDir
|
||||
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.namespace: "ZShell-Bar"
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
|
||||
@@ -33,6 +34,7 @@ Variants {
|
||||
WlrLayershell.namespace: "ZShell-Bar-Exclusion"
|
||||
screen: bar.screen
|
||||
WlrLayershell.layer: WlrLayer.Bottom
|
||||
WlrLayershell.exclusionMode: Config.autoHide && !visibilities.bar ? ExclusionMode.Ignore : ExclusionMode.Auto
|
||||
anchors {
|
||||
left: true
|
||||
right: true
|
||||
@@ -50,8 +52,9 @@ Variants {
|
||||
}
|
||||
|
||||
mask: Region {
|
||||
id: region
|
||||
x: 0
|
||||
y: 34
|
||||
y: !visibilities.bar ? 4 : 34
|
||||
|
||||
property list<Region> nullRegions: []
|
||||
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 dashboard
|
||||
property bool bar
|
||||
|
||||
Component.onCompleted: Visibilities.load(scope.modelData, this)
|
||||
}
|
||||
@@ -108,26 +112,32 @@ Variants {
|
||||
|
||||
Border {
|
||||
bar: backgroundRect
|
||||
visibilities: visibilities
|
||||
}
|
||||
|
||||
Backgrounds {
|
||||
visibilities: visibilities
|
||||
panels: panels
|
||||
bar: backgroundRect
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onContainsMouseChanged: {
|
||||
if ( !containsMouse ) {
|
||||
panels.popouts.hasCurrent = false;
|
||||
if ( !visibilities.sidebar && !visibilities.dashboard )
|
||||
visibilities.bar = Config.autoHide ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
onPositionChanged: event => {
|
||||
if ( mouseY < backgroundRect.implicitHeight ) {
|
||||
if ( !visibilities.bar ? mouseY < 4 : mouseY < backgroundRect.implicitHeight ) {
|
||||
visibilities.bar = true;
|
||||
barLoader.checkPopout(mouseX);
|
||||
}
|
||||
}
|
||||
@@ -161,10 +171,11 @@ Variants {
|
||||
Rectangle {
|
||||
id: backgroundRect
|
||||
property Wrapper popouts: panels.popouts
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
implicitHeight: 34
|
||||
anchors.topMargin: Config.autoHide && !visibilities.bar ? -30 : 0
|
||||
color: "transparent"
|
||||
radius: 0
|
||||
|
||||
@@ -172,6 +183,10 @@ Variants {
|
||||
CAnim {}
|
||||
}
|
||||
|
||||
Behavior on anchors.topMargin {
|
||||
Anim {}
|
||||
}
|
||||
|
||||
BarLoader {
|
||||
id: barLoader
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -32,6 +32,7 @@ Singleton {
|
||||
property alias general: adapter.general
|
||||
property alias dashboard: adapter.dashboard
|
||||
property alias appearance: adapter.appearance
|
||||
property alias autoHide: adapter.autoHide
|
||||
|
||||
FileView {
|
||||
id: root
|
||||
@@ -72,6 +73,7 @@ Singleton {
|
||||
property General general: General {}
|
||||
property DashboardConfig dashboard: DashboardConfig {}
|
||||
property AppearanceConf appearance: AppearanceConf {}
|
||||
property bool autoHide: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Shapes
|
||||
import qs.Modules as Modules
|
||||
@@ -11,10 +12,11 @@ Shape {
|
||||
|
||||
required property Panels panels
|
||||
required property Item bar
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
anchors.fill: parent
|
||||
// anchors.margins: 8
|
||||
anchors.topMargin: bar.implicitHeight
|
||||
anchors.topMargin: !root.visibilities.bar ? 4 : bar.implicitHeight
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
|
||||
Modules.Background {
|
||||
|
||||
@@ -23,9 +23,10 @@ RowLayout {
|
||||
required property ShellScreen screen
|
||||
|
||||
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;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import qs.Modules
|
||||
@@ -10,12 +11,13 @@ Item {
|
||||
id: root
|
||||
|
||||
required property Item bar
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
CustomRect {
|
||||
anchors.fill: parent
|
||||
color: DynamicColors.palette.m3surface
|
||||
color: Config.autoHide && !root.visibilities.bar ? "transparent" : DynamicColors.palette.m3surface
|
||||
|
||||
layer.enabled: true
|
||||
|
||||
@@ -36,9 +38,12 @@ Item {
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: root.bar.implicitHeight
|
||||
anchors.topMargin: Config.autoHide && !root.visibilities.bar ? 4 : root.bar.implicitHeight
|
||||
topLeftRadius: 8
|
||||
topRightRadius: 8
|
||||
Behavior on anchors.topMargin {
|
||||
Anim {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 3
|
||||
anchors.bottomMargin: 3
|
||||
anchors.topMargin: 4
|
||||
anchors.bottomMargin: 4
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
radius: 1000
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user