Cli tool #9
@@ -5,6 +5,7 @@ import QtQuick.Effects
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
|
import qs.Daemons
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Modules
|
import qs.Modules
|
||||||
import qs.Modules.Bar
|
import qs.Modules.Bar
|
||||||
@@ -26,7 +27,7 @@ Variants {
|
|||||||
|
|
||||||
WlrLayershell.namespace: "ZShell-Bar"
|
WlrLayershell.namespace: "ZShell-Bar"
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.keyboardFocus: visibilities.launcher ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.osd || visibilities.sidebar || visibilities.dashboard ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: exclusionZone
|
id: exclusionZone
|
||||||
WlrLayershell.namespace: "ZShell-Bar-Exclusion"
|
WlrLayershell.namespace: "ZShell-Bar-Exclusion"
|
||||||
@@ -82,7 +83,7 @@ Variants {
|
|||||||
HyprlandFocusGrab {
|
HyprlandFocusGrab {
|
||||||
id: focusGrab
|
id: focusGrab
|
||||||
|
|
||||||
active: visibilities.launcher
|
active: visibilities.launcher || visibilities.sidebar
|
||||||
windows: [bar]
|
windows: [bar]
|
||||||
onCleared: {
|
onCleared: {
|
||||||
visibilities.launcher = false;
|
visibilities.launcher = false;
|
||||||
@@ -92,14 +93,6 @@ Variants {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomShortcut {
|
|
||||||
name: "toggle-nc"
|
|
||||||
|
|
||||||
onPressed: {
|
|
||||||
visibilities.sidebar = !visibilities.sidebar
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PersistentProperties {
|
PersistentProperties {
|
||||||
id: visibilities
|
id: visibilities
|
||||||
|
|
||||||
@@ -108,10 +101,18 @@ Variants {
|
|||||||
property bool bar
|
property bool bar
|
||||||
property bool osd
|
property bool osd
|
||||||
property bool launcher
|
property bool launcher
|
||||||
|
property bool notif: NotifServer.popups.length > 0
|
||||||
|
|
||||||
Component.onCompleted: Visibilities.load(scope.modelData, this)
|
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 {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
opacity: Appearance.transparency.enabled ? DynamicColors.transparency.base : 1
|
opacity: Appearance.transparency.enabled ? DynamicColors.transparency.base : 1
|
||||||
@@ -150,7 +151,7 @@ Variants {
|
|||||||
visibilities: visibilities
|
visibilities: visibilities
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
CustomRect {
|
||||||
id: backgroundRect
|
id: backgroundRect
|
||||||
property Wrapper popouts: panels.popouts
|
property Wrapper popouts: panels.popouts
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ Singleton {
|
|||||||
property list<var> actions
|
property list<var> actions
|
||||||
|
|
||||||
readonly property Timer timer: Timer {
|
readonly property Timer timer: Timer {
|
||||||
property int totalTime: 5000
|
property int totalTime: Config.notifs.defaultExpireTimeout
|
||||||
property int remainingTime: totalTime
|
property int remainingTime: totalTime
|
||||||
property bool paused: false
|
property bool paused: false
|
||||||
|
|
||||||
|
|||||||
@@ -223,6 +223,10 @@ CustomMouseArea {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSidebarChanged() {
|
||||||
|
// root.visibilities.bar = root.visibilities.sidebar
|
||||||
|
}
|
||||||
|
|
||||||
function onDashboardChanged() {
|
function onDashboardChanged() {
|
||||||
if (root.visibilities.dashboard) {
|
if (root.visibilities.dashboard) {
|
||||||
// Dashboard became visible, immediately check if this should be shortcut mode
|
// Dashboard became visible, immediately check if this should be shortcut mode
|
||||||
@@ -230,9 +234,11 @@ CustomMouseArea {
|
|||||||
if (!inDashboardArea) {
|
if (!inDashboardArea) {
|
||||||
root.dashboardShortcutActive = true;
|
root.dashboardShortcutActive = true;
|
||||||
}
|
}
|
||||||
|
// root.visibilities.bar = true;
|
||||||
} else {
|
} else {
|
||||||
// Dashboard hidden, clear shortcut flag
|
// Dashboard hidden, clear shortcut flag
|
||||||
root.dashboardShortcutActive = false;
|
root.dashboardShortcutActive = false;
|
||||||
|
// root.visibilities.bar = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -29,7 +29,10 @@ Item {
|
|||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
// anchors.margins: 8
|
// anchors.margins: 8
|
||||||
anchors.topMargin: bar.implicitHeight
|
anchors.topMargin: visibilities.bar ? bar.implicitHeight : 0
|
||||||
|
Behavior on anchors.topMargin {
|
||||||
|
Modules.Anim {}
|
||||||
|
}
|
||||||
|
|
||||||
Osd.Wrapper {
|
Osd.Wrapper {
|
||||||
id: osd
|
id: osd
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ ShapePath {
|
|||||||
readonly property real utilsWidthDiff: panels.utilities.width - wrapper.width
|
readonly property real utilsWidthDiff: panels.utilities.width - wrapper.width
|
||||||
readonly property real utilsRoundingX: utilsWidthDiff < rounding * 2 ? utilsWidthDiff / 2 : rounding
|
readonly property real utilsRoundingX: utilsWidthDiff < rounding * 2 ? utilsWidthDiff / 2 : rounding
|
||||||
|
|
||||||
|
readonly property bool flatten: wrapper.width < rounding * 2
|
||||||
|
|
||||||
strokeWidth: -1
|
strokeWidth: -1
|
||||||
fillColor: DynamicColors.palette.m3surface
|
fillColor: flatten ? "transparent" : DynamicColors.palette.m3surface
|
||||||
|
|
||||||
PathLine {
|
PathLine {
|
||||||
relativeX: -root.wrapper.width - root.notifsRoundingX
|
relativeX: -root.wrapper.width - root.notifsRoundingX
|
||||||
|
|||||||
@@ -105,14 +105,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomShortcut {
|
|
||||||
name: "show-osd"
|
|
||||||
|
|
||||||
onPressed: {
|
|
||||||
root.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: timer
|
id: timer
|
||||||
|
|
||||||
|
|||||||
@@ -22,4 +22,22 @@ Scope {
|
|||||||
root.launcherInterrupted = false;
|
root.launcherInterrupted = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CustomShortcut {
|
||||||
|
name: "toggle-nc"
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
const visibilities = Visibilities.getForActive()
|
||||||
|
visibilities.sidebar = !visibilities.sidebar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomShortcut {
|
||||||
|
name: "show-osd"
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
const visibilities = Visibilities.getForActive()
|
||||||
|
visibilities.osd = !visibilities.osd
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user