hefty: bar: fix some alignment issues for floating

This commit is contained in:
end-4
2026-03-22 09:58:22 +01:00
parent 193d82847a
commit d52fbe0b40
5 changed files with 11 additions and 7 deletions
@@ -174,8 +174,8 @@ HAbstractMorphedPanel {
anchors { anchors {
top: parent.top top: parent.top
bottom: undefined bottom: undefined
left: undefined left: parent.left
right: undefined right: parent.right
} }
states: [ states: [
State { State {
@@ -22,6 +22,7 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.right: !root.vertical ? centerLeftSide.left : parent.right anchors.right: !root.vertical ? centerLeftSide.left : parent.right
anchors.bottom: !root.vertical ? parent.bottom : centerLeftSide.top anchors.bottom: !root.vertical ? parent.bottom : centerLeftSide.top
anchors.leftMargin: 0 // For accessibility
HBarUserFallbackComponentRepeater { HBarUserFallbackComponentRepeater {
componentNames: root.leftWidgets componentNames: root.leftWidgets
@@ -66,6 +67,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: !root.vertical ? centerRightSide.right : parent.left anchors.left: !root.vertical ? centerRightSide.right : parent.left
anchors.top: !root.vertical ? parent.top : centerRightSide.bottom anchors.top: !root.vertical ? parent.top : centerRightSide.bottom
anchors.rightMargin: 0 // For accessibility
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
@@ -8,11 +8,11 @@ import qs.modules.common.widgets as W
Repeater { Repeater {
id: root id: root
readonly property bool vertical: C.Config.options.bar.vertical
readonly property string invisibleItem: "_invisible" readonly property string invisibleItem: "_invisible"
required property list<var> componentNames required property list<var> componentNames
property string context: Quickshell.shellPath("modules/hefty/topLayer/bar/widgets") property string context: Quickshell.shellPath("modules/hefty/topLayer/bar/widgets")
model: { model: {
const m = componentNames.map(item => { const m = componentNames.map(item => {
if (item instanceof Array) if (item instanceof Array)
@@ -50,8 +50,8 @@ Repeater {
property bool startSide: index === 0 property bool startSide: index === 0
property bool endSide: index === root.model.length - 1 property bool endSide: index === root.model.length - 1
Layout.fillWidth: item.Layout.fillWidth Layout.fillWidth: root.vertical ? true : item.Layout.fillWidth
Layout.fillHeight: item.Layout.fillHeight Layout.fillHeight: !root.vertical ? true : item.Layout.fillHeight
Layout.maximumWidth: item.Layout.maximumWidth Layout.maximumWidth: item.Layout.maximumWidth
Layout.maximumHeight: item.Layout.maximumHeight Layout.maximumHeight: item.Layout.maximumHeight
} }
@@ -21,6 +21,8 @@ W.ButtonMouseArea {
property real layoutParentBottomRightRadius: layoutParent.bottomRightRadius property real layoutParentBottomRightRadius: layoutParent.bottomRightRadius
readonly property real barThickness: vertical ? C.Appearance.sizes.verticalBarWidth : C.Appearance.sizes.barHeight readonly property real barThickness: vertical ? C.Appearance.sizes.verticalBarWidth : C.Appearance.sizes.barHeight
readonly property real barVisualThickness: vertical ? C.Appearance.sizes.baseVerticalBarWidth : C.Appearance.sizes.baseBarHeight
readonly property real barGap: (barThickness - barVisualThickness) / 2
required property real contentImplicitWidth required property real contentImplicitWidth
required property real contentImplicitHeight required property real contentImplicitHeight
property real parentRadiusToPaddingRatio: 0.3 property real parentRadiusToPaddingRatio: 0.3
@@ -33,7 +35,7 @@ W.ButtonMouseArea {
W.StateOverlay { W.StateOverlay {
id: hoverOverlay id: hoverOverlay
anchors.fill: parent anchors.fill: parent
property real parentMargins: 4 property real parentMargins: 4 + root.barGap
property real ownMargins: 2 property real ownMargins: 2
property real edgeMargins: parentMargins + ownMargins property real edgeMargins: parentMargins + ownMargins
property real sideMargins: -2 property real sideMargins: -2
@@ -33,7 +33,7 @@ HBarWidgetWithPopout {
property real fontPixelSize: Appearance.font.pixelSize.smaller property real fontPixelSize: Appearance.font.pixelSize.smaller
Layout.maximumWidth: implicitWidth Layout.maximumWidth: vertical ? -1 : implicitWidth
Layout.fillWidth: true Layout.fillWidth: true
popupContentWidth: popupContent.implicitWidth popupContentWidth: popupContent.implicitWidth