diff --git a/nix/modules/home/quickshell/test/bar/LauncherButton.qml b/nix/modules/home/quickshell/test/bar/LauncherButton.qml new file mode 100644 index 0000000..6d20732 --- /dev/null +++ b/nix/modules/home/quickshell/test/bar/LauncherButton.qml @@ -0,0 +1,31 @@ +import QtQuick +import Quickshell +import qs.services + +// Leftmost button: opens the application launcher (walker, Mod+Space). +// Waybar styled this glyph @primary; kept as the accent here so the logo +// reads as an affordance, not as a status. +Text { + id: root + + text: "󱄅" + color: Theme.accent + font.family: Theme.fontFamily + font.pixelSize: 16 + + MouseArea { + id: mouse + + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: Quickshell.execDetached(["walker"]) + } + + opacity: mouse.containsMouse ? 1.0 : 0.8 + + Behavior on opacity { + NumberAnimation { duration: 120 } + } +} diff --git a/nix/modules/home/quickshell/test/bar/Left.qml b/nix/modules/home/quickshell/test/bar/Left.qml index 47b3022..576b9c0 100644 --- a/nix/modules/home/quickshell/test/bar/Left.qml +++ b/nix/modules/home/quickshell/test/bar/Left.qml @@ -1,8 +1,17 @@ import QtQuick import QtQuick.Layouts +import qs.services RowLayout { - spacing: 28 + spacing: Theme.spacing + + HangingTab { + sideMargin: 10 + + LauncherButton { + Layout.alignment: Qt.AlignVCenter + } + } Workspaces {} System {} diff --git a/nix/modules/home/quickshell/test/bar/PowerButton.qml b/nix/modules/home/quickshell/test/bar/PowerButton.qml new file mode 100644 index 0000000..2ba2a41 --- /dev/null +++ b/nix/modules/home/quickshell/test/bar/PowerButton.qml @@ -0,0 +1,26 @@ +import QtQuick +import Quickshell +import qs.services + +Text { + id: root + + text: "󰐥" + color: mouse.containsMouse ? Theme.accent : Theme.text + font.family: Theme.fontFamily + font.pixelSize: Theme.fontSize + + MouseArea { + id: mouse + + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: Quickshell.execDetached(["power-menu"]) + } + + Behavior on color { + ColorAnimation { duration: 120 } + } +} diff --git a/nix/modules/home/quickshell/test/bar/Right.qml b/nix/modules/home/quickshell/test/bar/Right.qml index 1f2c1b5..d76350a 100644 --- a/nix/modules/home/quickshell/test/bar/Right.qml +++ b/nix/modules/home/quickshell/test/bar/Right.qml @@ -1,12 +1,21 @@ import QtQuick import QtQuick.Layouts +import qs.services RowLayout { - spacing: 10 + spacing: Theme.spacing Tray { Layout.alignment: Qt.AlignVCenter } Time {} + + HangingTab { + sideMargin: 10 + + PowerButton { + Layout.alignment: Qt.AlignVCenter + } + } } diff --git a/nix/modules/home/quickshell/test/services/Theme.qml b/nix/modules/home/quickshell/test/services/Theme.qml index 7392724..9ed485e 100644 --- a/nix/modules/home/quickshell/test/services/Theme.qml +++ b/nix/modules/home/quickshell/test/services/Theme.qml @@ -27,25 +27,20 @@ Singleton { } } - // Pill container against the wallpaper. - readonly property string base: colour("base", "#ff00ff") + function shade(c, factor) { + const col = (typeof c === "string") ? Qt.color(c) : c + return Qt.hsla(col.hslHue, col.hslSaturation, Math.min(1, col.hslLightness * factor), col.a) + } - // Inactive pills, one step up the elevation ramp. + readonly property string base: colour("base", "#ff00ff") readonly property string surface: colour("surface", "#00ff00") - // Primary label text. readonly property string text: colour("text", "#ff00ff") - - // Dim label text (clock, battery). readonly property string subtext: colour("subtext", "#00ff00") - // Focused pill. readonly property string accent: colour("accent", "#ff00ff") - - // Label on the focused pill. readonly property string onAccent: colour("onAccent", "#000000") - // Gauge state colours, matching waybar's .warning/.critical (bar.nix). readonly property string tertiary: colour("tertiary", "#ff00ff") readonly property string error: colour("error", "#00ff00") @@ -53,14 +48,6 @@ Singleton { readonly property int fontSize: 13 - // Shade a colour by scaling HSL lightness: factor < 1 darkens, > 1 - // lightens (clamped by Qt). Perceptually even — unlike multiplying RGB, - // which collapses on the dark surface roles matugen emits. Accepts a hex - // string or color; callers pass Theme properties (strings), and explicit - // Qt.color() coercion beats typed parameters, which quickshell's compiled - // QML did not honour. - function shade(c, factor) { - const col = (typeof c === "string") ? Qt.color(c) : c - return Qt.hsla(col.hslHue, col.hslSaturation, Math.min(1, col.hslLightness * factor), col.a) - } + // Default gap between bar segments (Left/Right RowLayout spacing). + readonly property int spacing: 30 }