feat: vertical bar actually works!!!
This commit is contained in:
parent
2809db1506
commit
f98036a303
8 changed files with 31 additions and 5 deletions
|
|
@ -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: " "
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ Variants {
|
|||
|
||||
anchors.top: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
// anchors.right: true
|
||||
anchors.bottom: true
|
||||
|
||||
// Connections {
|
||||
// target: BarConfig
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ StyledRect {
|
|||
|
||||
text: "calendar_month"
|
||||
color: root.colour
|
||||
|
||||
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
||||
}
|
||||
|
||||
AnchorText {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue