diff --git a/.config/quickshell/ReloadPopup.qml b/.config/quickshell/ReloadPopup.qml index ec0a9153..c3f0aab9 100644 --- a/.config/quickshell/ReloadPopup.qml +++ b/.config/quickshell/ReloadPopup.qml @@ -67,6 +67,7 @@ Scope { ColumnLayout { id: layout + spacing: 10 anchors { top: parent.top topMargin: 10 @@ -78,7 +79,7 @@ Scope { font.family: "Rubik" font.pointSize: 14 // color: Appearance.colors.colOnBackground - text: root.failed ? "Reload failed" : "Reload completed" + text: root.failed ? "Quickshell: Reload failed" : "Quickshell reloaded" color: failed ? "#ff93000A" : "#ff0C1F13" } diff --git a/.config/quickshell/modules/bar/ActiveWindow.qml b/.config/quickshell/modules/bar/ActiveWindow.qml index e2ab07c9..39b34fa1 100644 --- a/.config/quickshell/modules/bar/ActiveWindow.qml +++ b/.config/quickshell/modules/bar/ActiveWindow.qml @@ -9,7 +9,7 @@ Item { required property var bar readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen) readonly property Toplevel activeWindow: ToplevelManager.activeToplevel - property int preferredWidth: 400 + property int preferredWidth: Appearance.sizes.barPreferredSideSectionWidth height: parent.height width: colLayout.width diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index e84697e6..b31ac371 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -4,6 +4,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import Quickshell +import Quickshell.Io Scope { id: bar @@ -11,6 +12,15 @@ Scope { readonly property int barHeight: Appearance.sizes.barHeight readonly property int barCenterSideModuleWidth: Appearance.sizes.barCenterSideModuleWidth + Process { + id: toggleSidebarRight + command: ["qs", "ipc", "call", "sidebarRight", "toggle"] + } + Process { + id: toggleSidebarLeft + command: ["qs", "ipc", "call", "sidebarLeft", "toggle"] + } + Variants { model: Quickshell.screens @@ -42,6 +52,7 @@ Scope { height: barHeight // Left section RowLayout { + id: leftSection anchors.left: parent.left implicitHeight: barHeight @@ -64,6 +75,7 @@ Scope { // Middle section RowLayout { + id: middleSection anchors.centerIn: parent spacing: 8 @@ -117,18 +129,37 @@ Scope { // Right section RowLayout { + id: rightSection anchors.right: parent.right implicitHeight: barHeight + width: Appearance.sizes.barPreferredSideSectionWidth spacing: 20 - - SysTray { - bar: barRoot - } + layoutDirection: Qt.RightToLeft Item { // TODO make this wifi & bluetooth Layout.leftMargin: Appearance.rounding.screenRounding + Layout.fillWidth: false } + SysTray { + bar: barRoot + Layout.fillWidth: false + } + + Item { + Layout.fillWidth: true + } + + + } + MouseArea { + anchors.fill: rightSection + acceptedButtons: Qt.LeftButton + onPressed: (event) => { + if (event.button === Qt.LeftButton) { + toggleSidebarRight.running = true + } + } // Scroll to change volume WheelHandler { onWheel: (event) => { @@ -141,7 +172,6 @@ Scope { } acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad } - } } diff --git a/.config/quickshell/modules/common/Appearance.qml b/.config/quickshell/modules/common/Appearance.qml index 6190a3ac..b290c2a9 100644 --- a/.config/quickshell/modules/common/Appearance.qml +++ b/.config/quickshell/modules/common/Appearance.qml @@ -162,6 +162,7 @@ Singleton { sizes: QtObject { property int barHeight: 40 property int barCenterSideModuleWidth: 360 + property int barPreferredSideSectionWidth: 400 property int sidebarWidth: 450 property int hyprlandGapsOut: 5 property int elevationMargin: 7 diff --git a/.config/quickshell/modules/sidebarRight/SidebarRight.qml b/.config/quickshell/modules/sidebarRight/SidebarRight.qml index f6643c89..b26d59ee 100644 --- a/.config/quickshell/modules/sidebarRight/SidebarRight.qml +++ b/.config/quickshell/modules/sidebarRight/SidebarRight.qml @@ -21,6 +21,7 @@ Scope { PanelWindow { id: sidebarRoot visible: false + focusable: true property var modelData @@ -36,6 +37,12 @@ Scope { bottom: true } + HyprlandFocusGrab { + active: sidebarRoot.visible + id: grab + windows: [ sidebarRoot ] + } + // Background Rectangle { id: sidebarRightBackground @@ -45,6 +52,14 @@ Scope { height: parent.height - Appearance.sizes.hyprlandGapsOut * 2 color: Appearance.colors.colLayer0 radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1 + + focus: true + Keys.onPressed: { + if (event.key === Qt.Key_Escape) { + sidebarRoot.visible = false; + event.accepted = true; // Prevent further propagation of the event + } + } } // Shadow