diff --git a/quickshell/ui/TopBar.qml b/quickshell/ui/TopBar.qml index 22216ea..2514792 100644 --- a/quickshell/ui/TopBar.qml +++ b/quickshell/ui/TopBar.qml @@ -28,37 +28,8 @@ Item { id: workspaceHelpers } - // ===================== - // LEFT: Workspaces - // ===================== - RowLayout { - spacing: 10 - - Repeater { - model: 10 - - Text { - required property int index - - property int wsId: index + 1 - property var ws: workspaceHelpers.getWorkspace(wsId) - - text: wsId - - color: workspaceHelpers.isWorkspaceActive(wsId) ? Colors.md3.primary : (ws ? Colors.md3.on_background : Colors.md3.on_secondary) - - font { - family: Constants.fontFamily - pixelSize: Constants.fontSize - bold: true - } - - MouseArea { - anchors.fill: parent - onClicked: Hyprland.dispatch("workspace " + wsId) - } - } - } + WorkspacesList { + id: workspacesList } // Spacer diff --git a/quickshell/ui/WorkspacesList.qml b/quickshell/ui/WorkspacesList.qml new file mode 100644 index 0000000..c9f46ff --- /dev/null +++ b/quickshell/ui/WorkspacesList.qml @@ -0,0 +1,35 @@ +import Quickshell.Hyprland +import QtQuick +import QtQuick.Layouts + +import "../constants" + +RowLayout { + spacing: 10 + + Repeater { + model: 10 + + Text { + required property int index + + property int wsId: index + 1 + property var ws: workspaceHelpers.getWorkspace(wsId) + + text: wsId + + color: workspaceHelpers.isWorkspaceActive(wsId) ? Colors.md3.primary : (ws ? Colors.md3.on_background : Colors.md3.on_secondary) + + font { + family: Constants.fontFamily + pixelSize: Constants.fontSize + bold: true + } + + MouseArea { + anchors.fill: parent + onClicked: Hyprland.dispatch("workspace " + wsId) + } + } + } +}