From d63693e87a851367757f752941990d02e4c5f48c Mon Sep 17 00:00:00 2001 From: rope Date: Tue, 26 May 2026 10:16:55 +0100 Subject: [PATCH] quickshell: underline workspaces, dropdown tray Co-Authored-By: Claude Opus 4.6 --- settings/hyprland.nix | 102 +++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 27 deletions(-) diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 0b01028..07be4e4 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -573,6 +573,7 @@ in model: Quickshell.screens PanelWindow { + id: bar required property var modelData screen: modelData @@ -582,7 +583,7 @@ in right: true } - implicitHeight: 32 + implicitHeight: 30 color: "#${c.base00}" RowLayout { @@ -597,12 +598,10 @@ in Repeater { model: Hyprland.workspaces - Rectangle { + Item { required property var modelData - Layout.preferredWidth: 32 - Layout.preferredHeight: 32 - color: modelData.focused ? "#${c.base02}" : "transparent" - radius: 6 + Layout.preferredWidth: 28 + Layout.preferredHeight: 30 Text { anchors.centerIn: parent @@ -610,7 +609,16 @@ in color: modelData.focused ? "#${c.base05}" : "#${c.base03}" font.family: "FiraMono Nerd Font" font.pixelSize: 13 - font.weight: modelData.focused ? Font.Bold : Font.Normal + } + + // Underline indicator + Rectangle { + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width - 8 + height: 2 + color: "#${c.base05}" + visible: modelData.focused } MouseArea { @@ -624,29 +632,69 @@ in // Spacer Item { Layout.fillWidth: true } - // System tray - RowLayout { - spacing: 4 - Layout.rightMargin: 8 + // Tray toggle button + Item { + Layout.preferredWidth: 28 + Layout.preferredHeight: 30 + Layout.rightMargin: 6 - Repeater { - model: SystemTray.items + Text { + anchors.centerIn: parent + text: "\ue0b2" + color: "#${c.base05}" + font.family: "FiraMono Nerd Font" + font.pixelSize: 13 + textFormat: Text.PlainText + } - Image { - required property var modelData - source: modelData.icon - Layout.preferredWidth: 18 - Layout.preferredHeight: 18 - smooth: true + MouseArea { + anchors.fill: parent + onClicked: trayPopup.visible = !trayPopup.visible + } + } + } - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: (event) => { - if (event.button === Qt.RightButton && parent.modelData.hasMenu) { - parent.modelData.menu.open(); - } else { - parent.modelData.activate(); + PopupWindow { + id: trayPopup + anchor.window: bar + anchor.rect.x: bar.width - 220 + anchor.rect.y: bar.height + visible: false + color: "#${c.base00}" + implicitWidth: trayRow.width + 24 + implicitHeight: 40 + + Rectangle { + anchors.fill: parent + color: "#${c.base00}" + border.color: "#${c.base03}" + border.width: 1 + radius: 8 + + RowLayout { + id: trayRow + anchors.centerIn: parent + spacing: 8 + + Repeater { + model: SystemTray.items + + Image { + required property var modelData + source: modelData.icon + Layout.preferredWidth: 18 + Layout.preferredHeight: 18 + smooth: true + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: (event) => { + if (event.button === Qt.RightButton && parent.modelData.hasMenu) { + parent.modelData.menu.open(); + } else { + parent.modelData.activate(); + } } } }