left-bar working, bottom bar semi-broken
This commit is contained in:
+34
-15
@@ -13,41 +13,57 @@ Item {
|
||||
|
||||
property real activeWorkspaceMargin: Math.ceil(Appearance.padding.small / 2)
|
||||
readonly property int effectiveActiveWorkspaceId: monitor?.activeWorkspace?.id ?? 1
|
||||
required property bool horizontal
|
||||
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen)
|
||||
required property ShellScreen screen
|
||||
property int workspaceButtonWidth: bgRect.implicitHeight - root.activeWorkspaceMargin * 2
|
||||
readonly property real shortSize: Config.bar.height + Appearance.padding.smaller * 2
|
||||
readonly property real size: (workspaceButtonWidth * workspacesShown) + activeWorkspaceMargin * 2
|
||||
property int workspaceButtonWidth: (horizontal ? bgRect.implicitHeight : bgRect.implicitWidth) - root.activeWorkspaceMargin * 2
|
||||
property int workspaceIndexInGroup: (effectiveActiveWorkspaceId - 1) % root.workspacesShown
|
||||
readonly property list<var> workspaces: Hyprland.workspaces.values.filter(w => w.monitor === root.monitor)
|
||||
readonly property int workspacesShown: workspaces.length
|
||||
|
||||
height: implicitHeight
|
||||
implicitHeight: Config.bar.height + Appearance.padding.smaller * 2
|
||||
implicitWidth: (root.workspaceButtonWidth * root.workspacesShown) + root.activeWorkspaceMargin * 2
|
||||
implicitHeight: horizontal ? shortSize : size
|
||||
implicitWidth: horizontal ? size : shortSize
|
||||
|
||||
Behavior on implicitHeight {
|
||||
enabled: !root.horizontal
|
||||
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on implicitWidth {
|
||||
enabled: root.horizontal
|
||||
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
|
||||
CustomRect {
|
||||
// qmllint disable Quick.anchor-combinations
|
||||
id: bgRect
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.bottom: root.horizontal ? undefined : parent.bottom
|
||||
anchors.horizontalCenter: root.horizontal ? undefined : parent.horizontalCenter
|
||||
anchors.left: root.horizontal ? parent.left : undefined
|
||||
anchors.right: root.horizontal ? parent.right : undefined
|
||||
anchors.top: root.horizontal ? undefined : parent.top
|
||||
anchors.verticalCenter: root.horizontal ? parent.verticalCenter : undefined
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
implicitHeight: root.implicitHeight - ((Appearance.padding.small - 1) * 2)
|
||||
implicitHeight: root.horizontal ? root.implicitHeight - ((Appearance.padding.small - 1) * 2) : 0
|
||||
implicitWidth: root.horizontal ? 0 : root.implicitWidth - ((Appearance.padding.small - 1) * 2)
|
||||
radius: height / 2
|
||||
|
||||
// qmllint enable Quick.anchor-combinations
|
||||
Grid {
|
||||
id: grid
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: root.activeWorkspaceMargin
|
||||
columnSpacing: 0
|
||||
columns: root.workspacesShown
|
||||
columns: root.horizontal ? root.workspacesShown : 1
|
||||
rowSpacing: 0
|
||||
rows: 1
|
||||
rows: root.horizontal ? 1 : root.workspacesShown
|
||||
|
||||
Repeater {
|
||||
model: root.workspaces
|
||||
@@ -93,13 +109,15 @@ Item {
|
||||
property real indicatorPosition: Math.min(idxPair.idx1, idxPair.idx2) * root.workspaceButtonWidth + root.activeWorkspaceMargin
|
||||
property real indicatorThickness: root.workspaceButtonWidth
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: root.horizontal ? undefined : parent.horizontalCenter
|
||||
anchors.verticalCenter: root.horizontal ? parent.verticalCenter : undefined
|
||||
clip: true
|
||||
color: DynamicColors.palette.m3primary
|
||||
implicitHeight: indicatorThickness
|
||||
implicitWidth: indicatorLength
|
||||
implicitHeight: root.horizontal ? indicatorThickness : indicatorLength
|
||||
implicitWidth: root.horizontal ? indicatorLength : indicatorThickness
|
||||
radius: Appearance.rounding.full
|
||||
x: indicatorPosition
|
||||
x: root.horizontal ? indicatorPosition : 0
|
||||
y: root.horizontal ? 0 : indicatorPosition
|
||||
|
||||
AnimatedTabIndexPair {
|
||||
id: idxPair
|
||||
@@ -113,7 +131,8 @@ Item {
|
||||
implicitWidth: grid.width
|
||||
source: grid
|
||||
sourceColor: DynamicColors.palette.m3onSurface
|
||||
x: -indicator.x + 3
|
||||
x: root.horizontal ? -indicator.x + 3 : 0
|
||||
y: root.horizontal ? 0 : -indicator.y + 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user