diff options
| -rw-r--r-- | config/BarConfig.qml | 6 | ||||
| -rw-r--r-- | modules/bar/Bar.qml | 3 | ||||
| -rw-r--r-- | modules/bar/Panel.qml | 3 | ||||
| -rw-r--r-- | modules/bar/Pills.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/ActiveWindow.qml | 16 | ||||
| -rw-r--r-- | modules/bar/components/Clock.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/StatusIcons.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspace.qml | 2 |
8 files changed, 31 insertions, 5 deletions
diff --git a/config/BarConfig.qml b/config/BarConfig.qml index 99f7796..83186b6 100644 --- a/config/BarConfig.qml +++ b/config/BarConfig.qml @@ -7,7 +7,7 @@ import QtQuick Singleton { id: root - property bool vertical: false + property bool vertical: true property Preset preset: presets.pills readonly property Sizes sizes: preset.sizes @@ -26,9 +26,9 @@ Singleton { } component Workspaces: QtObject { - property int shown: 10 + property int shown: root.vertical ? 5 : 10 property bool rounded: true - property bool occupiedBg: true + property bool occupiedBg: false property bool showWindows: true property bool activeTrail: !showWindows // Doesn't work well with variable sized workspaces property string label: " " diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index c6761c7..c9b6044 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -19,7 +19,8 @@ Variants { anchors.top: true anchors.left: true - anchors.right: true + // anchors.right: true + anchors.bottom: true // Connections { // target: BarConfig diff --git a/modules/bar/Panel.qml b/modules/bar/Panel.qml index 62d2776..fa71cf7 100644 --- a/modules/bar/Panel.qml +++ b/modules/bar/Panel.qml @@ -12,6 +12,7 @@ StyledRect { return BarConfig.vertical ? vert : horiz; } + vertical: BarConfig.vertical color: Appearance.alpha(Appearance.colours.m3surface, false) anchors.fill: parent @@ -92,6 +93,8 @@ StyledRect { Power { x: (BarConfig.sizes.height - width) / 2 + y: (BarConfig.sizes.height - height) / 2 + color: Appearance.colours.m3onError anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) diff --git a/modules/bar/Pills.qml b/modules/bar/Pills.qml index 46e55d4..556870d 100644 --- a/modules/bar/Pills.qml +++ b/modules/bar/Pills.qml @@ -12,6 +12,7 @@ BoxLayout { return BarConfig.vertical ? vert : horiz; } + vertical: BarConfig.vertical spacing: Appearance.padding.large anchors.fill: parent @@ -98,6 +99,7 @@ BoxLayout { Power { // Center in pill x: (BarConfig.sizes.height - width) / 2 + y: (BarConfig.sizes.height - height) / 2 anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) anchors.verticalCenter: root.get(parent.verticalCenter, undefined) diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml index 70ffb8c..de568dd 100644 --- a/modules/bar/components/ActiveWindow.qml +++ b/modules/bar/components/ActiveWindow.qml @@ -1,3 +1,5 @@ +pragma ComponentBehavior: Bound + import "root:/widgets" import "root:/services" import "root:/utils" @@ -18,16 +20,28 @@ StyledRect { animate: true text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows") color: root.colour + + anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined } AnchorText { + id: text + prevAnchor: icon text: metrics.elidedText font.pointSize: metrics.font.pointSize font.family: metrics.font.family color: root.colour - rotation: vertical ? 90 : 0 + + transform: Rotation { + angle: vertical ? 90 : 0 + origin.x: text.implicitHeight / 2 + origin.y: text.implicitHeight / 2 + } + + width: vertical ? implicitHeight : implicitWidth + height: vertical ? implicitWidth : implicitHeight } TextMetrics { diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml index 6758ea6..f3e3701 100644 --- a/modules/bar/components/Clock.qml +++ b/modules/bar/components/Clock.qml @@ -13,6 +13,8 @@ StyledRect { text: "calendar_month" color: root.colour + + anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined } AnchorText { diff --git a/modules/bar/components/StatusIcons.qml b/modules/bar/components/StatusIcons.qml index a393ea2..ae3bfad 100644 --- a/modules/bar/components/StatusIcons.qml +++ b/modules/bar/components/StatusIcons.qml @@ -20,6 +20,8 @@ StyledRect { animate: true text: Icons.getNetworkIcon(Network.active?.strength ?? 0) color: root.colour + + anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined } AnchorText { diff --git a/modules/bar/components/workspaces/Workspace.qml b/modules/bar/components/workspaces/Workspace.qml index 5d76861..97c99b0 100644 --- a/modules/bar/components/workspaces/Workspace.qml +++ b/modules/bar/components/workspaces/Workspace.qml @@ -52,6 +52,8 @@ Item { anchors.horizontalCenter: root.vertical ? indicator.horizontalCenter : undefined sourceComponent: Box { + vertical: root.vertical + Repeater { model: ScriptModel { values: Hyprland.clients.filter(c => c.workspace?.id === root.ws) |