mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #1625 from anthonyhab/fix/widget-centering-margins
fix(bar): consistent outer bar margin spacing
This commit is contained in:
+10
-4
@@ -336,11 +336,14 @@ Item {
|
||||
onClicked: root.triggerLastWidgetInSection("right")
|
||||
}
|
||||
|
||||
// Calculate margin to center widgets vertically within the bar height
|
||||
readonly property real verticalBarMargin: Math.round((root.barHeight - root.capsuleHeight) / 2)
|
||||
|
||||
// Top section (left widgets)
|
||||
ColumnLayout {
|
||||
x: Style.pixelAlignCenter(parent.width, width)
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.marginS
|
||||
anchors.topMargin: verticalBarMargin
|
||||
spacing: Style.marginS
|
||||
|
||||
Repeater {
|
||||
@@ -391,7 +394,7 @@ Item {
|
||||
ColumnLayout {
|
||||
x: Style.pixelAlignCenter(parent.width, width)
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: Style.marginS
|
||||
anchors.bottomMargin: verticalBarMargin
|
||||
spacing: Style.marginS
|
||||
|
||||
Repeater {
|
||||
@@ -440,12 +443,15 @@ Item {
|
||||
onClicked: root.triggerLastWidgetInSection("right")
|
||||
}
|
||||
|
||||
// Calculate margin to center widgets horizontally within the bar height
|
||||
readonly property real horizontalBarMargin: Math.round((root.barHeight - root.capsuleHeight) / 2)
|
||||
|
||||
// Left Section
|
||||
RowLayout {
|
||||
id: leftSection
|
||||
objectName: "leftSection"
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.marginS
|
||||
anchors.leftMargin: horizontalBarMargin
|
||||
y: Style.pixelAlignCenter(parent.height, height)
|
||||
spacing: Style.marginS
|
||||
|
||||
@@ -500,7 +506,7 @@ Item {
|
||||
id: rightSection
|
||||
objectName: "rightSection"
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.marginS
|
||||
anchors.rightMargin: horizontalBarMargin
|
||||
y: Style.pixelAlignCenter(parent.height, height)
|
||||
spacing: Style.marginS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user