organize files
This commit is contained in:
+197
@@ -0,0 +1,197 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import qs.Daemons
|
||||
import qs.Components
|
||||
import qs.Modules
|
||||
import qs.Modules.Bar
|
||||
import qs.Config
|
||||
import qs.Helpers
|
||||
import qs.Drawers
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
Scope {
|
||||
id: scope
|
||||
required property var modelData
|
||||
PanelWindow {
|
||||
id: bar
|
||||
property bool trayMenuVisible: false
|
||||
screen: scope.modelData
|
||||
color: "transparent"
|
||||
property var root: Quickshell.shellDir
|
||||
|
||||
WlrLayershell.namespace: "ZShell-Bar"
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.sidebar || visibilities.dashboard ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||
|
||||
contentItem.focus: true
|
||||
|
||||
contentItem.Keys.onEscapePressed: {
|
||||
if ( Config.barConfig.autoHide )
|
||||
visibilities.bar = false;
|
||||
visibilities.sidebar = false;
|
||||
visibilities.dashboard = false;
|
||||
visibilities.osd = false;
|
||||
}
|
||||
|
||||
PanelWindow {
|
||||
id: exclusionZone
|
||||
WlrLayershell.namespace: "ZShell-Bar-Exclusion"
|
||||
screen: bar.screen
|
||||
WlrLayershell.layer: WlrLayer.Bottom
|
||||
WlrLayershell.exclusionMode: Config.barConfig.autoHide ? ExclusionMode.Ignore : ExclusionMode.Auto
|
||||
anchors {
|
||||
left: true
|
||||
right: true
|
||||
top: true
|
||||
}
|
||||
color: "transparent"
|
||||
implicitHeight: 34
|
||||
}
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
mask: Region {
|
||||
id: region
|
||||
x: 0
|
||||
y: Config.barConfig.autoHide && !visibilities.bar ? 4 : 34
|
||||
|
||||
property list<Region> nullRegions: []
|
||||
|
||||
width: bar.width
|
||||
height: bar.screen.height - backgroundRect.implicitHeight
|
||||
intersection: Intersection.Xor
|
||||
|
||||
regions: popoutRegions.instances
|
||||
}
|
||||
|
||||
Variants {
|
||||
id: popoutRegions
|
||||
model: panels.children
|
||||
|
||||
Region {
|
||||
required property Item modelData
|
||||
|
||||
x: modelData.x
|
||||
y: modelData.y + backgroundRect.implicitHeight
|
||||
width: modelData.width
|
||||
height: modelData.height
|
||||
intersection: Intersection.Subtract
|
||||
}
|
||||
}
|
||||
|
||||
HyprlandFocusGrab {
|
||||
id: focusGrab
|
||||
|
||||
active: visibilities.launcher || visibilities.sidebar || visibilities.dashboard || ( panels.popouts.hasCurrent && panels.popouts.currentName.startsWith( "traymenu" ))
|
||||
windows: [bar]
|
||||
onCleared: {
|
||||
visibilities.launcher = false;
|
||||
visibilities.sidebar = false;
|
||||
visibilities.dashboard = false;
|
||||
visibilities.osd = false;
|
||||
panels.popouts.hasCurrent = false;
|
||||
}
|
||||
}
|
||||
|
||||
PersistentProperties {
|
||||
id: visibilities
|
||||
|
||||
property bool sidebar
|
||||
property bool dashboard
|
||||
property bool bar
|
||||
property bool osd
|
||||
property bool launcher
|
||||
property bool notif: NotifServer.popups.length > 0
|
||||
|
||||
Component.onCompleted: Visibilities.load(scope.modelData, this)
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: visibilities
|
||||
property: "bar"
|
||||
value: visibilities.sidebar || visibilities.dashboard || visibilities.osd || visibilities.notif
|
||||
when: Config.barConfig.autoHide
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
opacity: Appearance.transparency.enabled ? DynamicColors.transparency.base : 1
|
||||
layer.enabled: true
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
blurMax: 32
|
||||
shadowColor: Qt.alpha(DynamicColors.palette.m3shadow, 1)
|
||||
}
|
||||
|
||||
Border {
|
||||
bar: backgroundRect
|
||||
visibilities: visibilities
|
||||
}
|
||||
|
||||
Backgrounds {
|
||||
visibilities: visibilities
|
||||
panels: panels
|
||||
bar: backgroundRect
|
||||
}
|
||||
}
|
||||
|
||||
Interactions {
|
||||
id: mouseArea
|
||||
screen: scope.modelData
|
||||
popouts: panels.popouts
|
||||
visibilities: visibilities
|
||||
panels: panels
|
||||
bar: barLoader
|
||||
anchors.fill: parent
|
||||
|
||||
Panels {
|
||||
id: panels
|
||||
screen: scope.modelData
|
||||
bar: backgroundRect
|
||||
visibilities: visibilities
|
||||
}
|
||||
|
||||
CustomRect {
|
||||
id: backgroundRect
|
||||
property Wrapper popouts: panels.popouts
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
implicitHeight: 34
|
||||
anchors.topMargin: Config.barConfig.autoHide && !visibilities.bar ? -30 : 0
|
||||
color: "transparent"
|
||||
radius: 0
|
||||
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
|
||||
Behavior on anchors.topMargin {
|
||||
Anim {}
|
||||
}
|
||||
|
||||
BarLoader {
|
||||
id: barLoader
|
||||
anchors.fill: parent
|
||||
popouts: panels.popouts
|
||||
bar: bar
|
||||
visibilities: visibilities
|
||||
screen: scope.modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user