From 1d350e35d6dda9b87c5140a72b9b42a9bbb719ba Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Fri, 29 Aug 2025 15:59:17 -0400 Subject: [PATCH 1/3] move workspaces to icon button --- modules/bar/components/hyprland/Workspace.qml | 83 +++++++------------ .../bar/components/hyprland/Workspaces.qml | 14 +++- 2 files changed, 41 insertions(+), 56 deletions(-) diff --git a/modules/bar/components/hyprland/Workspace.qml b/modules/bar/components/hyprland/Workspace.qml index 47270ce..603f329 100644 --- a/modules/bar/components/hyprland/Workspace.qml +++ b/modules/bar/components/hyprland/Workspace.qml @@ -1,70 +1,43 @@ -pragma ComponentBehavior: Bound - +import qs.components import qs.config import qs.constants -import qs.widgets import QtQuick import Quickshell.Hyprland -Loader { +StyledIconButton { id: root - required property HyprlandWorkspace modelData - active: modelData.id > 0 + required property HyprlandWorkspace workspace - sourceComponent: workspace - property Component workspace: StyledButton { - id: clickable + text: Icons.triangle + font.bold: true + font.pixelSize: 17 + padding: 8 - onClicked: root.modelData.activate() + onClicked: root.workspace.activate() - content: Text { - id: icon - - font.family: Theme.lucide.font.family - font.pixelSize: Dimensions.workspace.iconSize - font.bold: true - text: Icons.triangle - - color: Theme.palette.basecontent - - states: [ - State { - name: "focused" - when: root.modelData.focused - PropertyChanges { - icon { - rotation: 180 - color: clickable.hovered ? Theme.palette.basecontent : Theme.palette.primary - } - } - }, - State { - name: "active" - when: root.modelData.active - PropertyChanges { - icon { - text: Icons.triangleDashed - rotation: 180 - color: clickable.hovered ? Theme.palette.basecontent : Theme.palette.primary - } - } + states: [ + State { + name: "focused" + when: root.workspace.focused + PropertyChanges { + root { + rotation: 180 + color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary + border.color: Theme.palette.secondary } - ] - - transitions: Transition { - reversible: true - ParallelAnimation { - RotationAnimation { - duration: 200 - easing.type: Easing.InOutCubic - } - ColorAnimation { - duration: 200 - easing.type: Easing.OutCubic - } + } + }, + State { + name: "active" + when: root.workspace.active + PropertyChanges { + root { + text: Icons.triangleDashed + rotation: 180 + color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary } } } - } + ] } diff --git a/modules/bar/components/hyprland/Workspaces.qml b/modules/bar/components/hyprland/Workspaces.qml index 25d6967..44a3e16 100644 --- a/modules/bar/components/hyprland/Workspaces.qml +++ b/modules/bar/components/hyprland/Workspaces.qml @@ -1,3 +1,5 @@ +pragma ComponentBehavior: Bound + import qs.config import QtQuick import QtQuick.Layouts @@ -12,6 +14,16 @@ RowLayout { model: Hyprland.workspaces - Workspace {} + Loader { + id: loader + required property HyprlandWorkspace modelData + + active: modelData.id > 0 + + sourceComponent: workspace + property Component workspace: Workspace { + workspace: loader.modelData + } + } } } From a0ccdc231ba2bcc65cb9a5318668b812301cba11 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Fri, 29 Aug 2025 16:03:31 -0400 Subject: [PATCH 2/3] migrate to iconbutton on tray --- modules/bar/components/tray/TrayItem.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/bar/components/tray/TrayItem.qml b/modules/bar/components/tray/TrayItem.qml index e199d8d..1e05ff7 100644 --- a/modules/bar/components/tray/TrayItem.qml +++ b/modules/bar/components/tray/TrayItem.qml @@ -1,20 +1,20 @@ pragma ComponentBehavior: Bound -import qs.widgets +import qs.components import QtQuick import Quickshell import Quickshell.Services.SystemTray import Quickshell.Widgets import "menu/" -StyledButton { +StyledIconButton { id: root property SystemTrayItem trayItem onClicked: menu.toggle() - content: IconImage { + contentItem: IconImage { id: icon asynchronous: true implicitSize: 18 From 0f7dbb804179a9d6ab97cc3832adf813d22f947a Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Fri, 29 Aug 2025 16:16:59 -0400 Subject: [PATCH 3/3] fucking ew --- modules/bar/components/hyprland/Workspace.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/bar/components/hyprland/Workspace.qml b/modules/bar/components/hyprland/Workspace.qml index 603f329..07acca9 100644 --- a/modules/bar/components/hyprland/Workspace.qml +++ b/modules/bar/components/hyprland/Workspace.qml @@ -24,7 +24,6 @@ StyledIconButton { root { rotation: 180 color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary - border.color: Theme.palette.secondary } } },