diff --git a/Bar.qml b/Bar.qml index 6ccd7cc..e946cbd 100644 --- a/Bar.qml +++ b/Bar.qml @@ -5,6 +5,7 @@ import QtQuick.Effects import Quickshell import Quickshell.Wayland import Quickshell.Hyprland +import qs.Daemons import qs.Components import qs.Modules import qs.Modules.Bar @@ -26,7 +27,7 @@ Variants { WlrLayershell.namespace: "ZShell-Bar" 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 { id: exclusionZone WlrLayershell.namespace: "ZShell-Bar-Exclusion" @@ -82,7 +83,7 @@ Variants { HyprlandFocusGrab { id: focusGrab - active: visibilities.launcher + active: visibilities.launcher || visibilities.sidebar windows: [bar] onCleared: { visibilities.launcher = false; @@ -92,14 +93,6 @@ Variants { } } - CustomShortcut { - name: "toggle-nc" - - onPressed: { - visibilities.sidebar = !visibilities.sidebar - } - } - PersistentProperties { id: visibilities @@ -108,10 +101,18 @@ Variants { 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 @@ -150,7 +151,7 @@ Variants { visibilities: visibilities } - Rectangle { + CustomRect { id: backgroundRect property Wrapper popouts: panels.popouts anchors.top: parent.top diff --git a/Daemons/NotifServer.qml b/Daemons/NotifServer.qml index 27c0987..6c2a5cd 100644 --- a/Daemons/NotifServer.qml +++ b/Daemons/NotifServer.qml @@ -177,7 +177,7 @@ Singleton { property list actions readonly property Timer timer: Timer { - property int totalTime: 5000 + property int totalTime: Config.notifs.defaultExpireTimeout property int remainingTime: totalTime property bool paused: false diff --git a/Drawers/Interactions.qml b/Drawers/Interactions.qml index 13ddf48..6e9b170 100644 --- a/Drawers/Interactions.qml +++ b/Drawers/Interactions.qml @@ -223,6 +223,10 @@ CustomMouseArea { } } + function onSidebarChanged() { + // root.visibilities.bar = root.visibilities.sidebar + } + function onDashboardChanged() { if (root.visibilities.dashboard) { // Dashboard became visible, immediately check if this should be shortcut mode @@ -230,9 +234,11 @@ CustomMouseArea { if (!inDashboardArea) { root.dashboardShortcutActive = true; } + // root.visibilities.bar = true; } else { // Dashboard hidden, clear shortcut flag root.dashboardShortcutActive = false; + // root.visibilities.bar = false; } } diff --git a/Drawers/Panels.qml b/Drawers/Panels.qml index 1fa90cd..457548e 100644 --- a/Drawers/Panels.qml +++ b/Drawers/Panels.qml @@ -29,7 +29,10 @@ Item { anchors.fill: parent // anchors.margins: 8 - anchors.topMargin: bar.implicitHeight + anchors.topMargin: visibilities.bar ? bar.implicitHeight : 0 + Behavior on anchors.topMargin { + Modules.Anim {} + } Osd.Wrapper { id: osd diff --git a/Modules/Notifications/Sidebar/Background.qml b/Modules/Notifications/Sidebar/Background.qml index 8749d21..3ca0a60 100644 --- a/Modules/Notifications/Sidebar/Background.qml +++ b/Modules/Notifications/Sidebar/Background.qml @@ -18,8 +18,10 @@ ShapePath { readonly property real utilsWidthDiff: panels.utilities.width - wrapper.width readonly property real utilsRoundingX: utilsWidthDiff < rounding * 2 ? utilsWidthDiff / 2 : rounding + readonly property bool flatten: wrapper.width < rounding * 2 + strokeWidth: -1 - fillColor: DynamicColors.palette.m3surface + fillColor: flatten ? "transparent" : DynamicColors.palette.m3surface PathLine { relativeX: -root.wrapper.width - root.notifsRoundingX diff --git a/Modules/Osd/Wrapper.qml b/Modules/Osd/Wrapper.qml index 0664212..53f361c 100644 --- a/Modules/Osd/Wrapper.qml +++ b/Modules/Osd/Wrapper.qml @@ -105,14 +105,6 @@ Item { } } - CustomShortcut { - name: "show-osd" - - onPressed: { - root.show(); - } - } - Timer { id: timer diff --git a/Modules/Shortcuts.qml b/Modules/Shortcuts.qml index 7d9eac7..6111b42 100644 --- a/Modules/Shortcuts.qml +++ b/Modules/Shortcuts.qml @@ -22,4 +22,22 @@ Scope { 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 + } + } }