diff --git a/modules/bar/components/hyprland/Workspace.qml b/modules/bar/components/hyprland/Workspace.qml index 07acca9..47270ce 100644 --- a/modules/bar/components/hyprland/Workspace.qml +++ b/modules/bar/components/hyprland/Workspace.qml @@ -1,42 +1,70 @@ -import qs.components +pragma ComponentBehavior: Bound + import qs.config import qs.constants +import qs.widgets import QtQuick import Quickshell.Hyprland -StyledIconButton { +Loader { id: root + required property HyprlandWorkspace modelData - required property HyprlandWorkspace workspace + active: modelData.id > 0 - text: Icons.triangle - font.bold: true - font.pixelSize: 17 - padding: 8 + sourceComponent: workspace + property Component workspace: StyledButton { + id: clickable - onClicked: root.workspace.activate() + onClicked: root.modelData.activate() - states: [ - State { - name: "focused" - when: root.workspace.focused - PropertyChanges { - root { - rotation: 180 - color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary + 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 + } + } } - } - }, - State { - name: "active" - when: root.workspace.active - PropertyChanges { - root { - text: Icons.triangleDashed - rotation: 180 - color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary + ] + + transitions: Transition { + reversible: true + ParallelAnimation { + RotationAnimation { + duration: 200 + easing.type: Easing.InOutCubic + } + ColorAnimation { + duration: 200 + easing.type: Easing.OutCubic + } } } } - ] + } } diff --git a/modules/bar/components/hyprland/Workspaces.qml b/modules/bar/components/hyprland/Workspaces.qml index 44a3e16..25d6967 100644 --- a/modules/bar/components/hyprland/Workspaces.qml +++ b/modules/bar/components/hyprland/Workspaces.qml @@ -1,5 +1,3 @@ -pragma ComponentBehavior: Bound - import qs.config import QtQuick import QtQuick.Layouts @@ -14,16 +12,6 @@ RowLayout { model: Hyprland.workspaces - Loader { - id: loader - required property HyprlandWorkspace modelData - - active: modelData.id > 0 - - sourceComponent: workspace - property Component workspace: Workspace { - workspace: loader.modelData - } - } + Workspace {} } } diff --git a/modules/bar/components/tray/TrayItem.qml b/modules/bar/components/tray/TrayItem.qml index 1e05ff7..e199d8d 100644 --- a/modules/bar/components/tray/TrayItem.qml +++ b/modules/bar/components/tray/TrayItem.qml @@ -1,20 +1,20 @@ pragma ComponentBehavior: Bound -import qs.components +import qs.widgets import QtQuick import Quickshell import Quickshell.Services.SystemTray import Quickshell.Widgets import "menu/" -StyledIconButton { +StyledButton { id: root property SystemTrayItem trayItem onClicked: menu.toggle() - contentItem: IconImage { + content: IconImage { id: icon asynchronous: true implicitSize: 18