hefty: bar: proper vertical layouting

This commit is contained in:
end-4
2026-02-06 22:38:45 +01:00
parent 8fccfef9f1
commit ea35ca1582
4 changed files with 69 additions and 19 deletions
@@ -1,3 +1,4 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import qs.modules.common as C
@@ -5,36 +6,70 @@ import qs.modules.common as C
Item {
id: root
property bool vertical: C.Config.options.bar.vertical
property real spacing: 4
Side {
id: leftSide
anchors.left: parent.left
width: (parent.width - centerSide.width) / 2
anchors.top: parent.top
HBarUserFallbackComponentRepeater {
componentNames: C.Config.options.hefty.bar.leftWidgets
}
}
Side {
id: centerLeftSide
anchors.right: !root.vertical ? centerSide.left : parent.right
anchors.bottom: root.vertical ? parent.bottom : undefined
HBarUserFallbackComponentRepeater {
componentNames: C.Config.options.hefty.bar.centerLeftWidgets
}
}
Side {
id: centerSide
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
HBarUserFallbackComponentRepeater {
componentNames: C.Config.options.hefty.bar.centerWidgets
}
}
Side {
id: centerRightSide
anchors.left: !root.vertical ? centerSide.right : parent.left
anchors.top: root.vertical ? parent.top : undefined
HBarUserFallbackComponentRepeater {
componentNames: C.Config.options.hefty.bar.centerRightWidgets
}
}
Side {
id: rightSide
anchors.right: parent.right
width: (parent.width - centerSide.width) / 2
anchors.bottom: parent.bottom
HBarUserFallbackComponentRepeater {
componentNames: C.Config.options.hefty.bar.rightWidgets
}
}
component Side: RowLayout {
component Side: GridLayout {
anchors {
top: parent.top
bottom: parent.bottom
top: !root.vertical ? parent.top : undefined
bottom: !root.vertical ? parent.bottom : undefined
topMargin: root.spacing * root.vertical
bottomMargin: root.spacing * root.vertical
left: root.vertical ? parent.left : undefined
right: root.vertical ? parent.right : undefined
leftMargin: root.spacing * !root.vertical
rightMargin: root.spacing * !root.vertical
}
columns: C.Config.options.bar.vertical ? 1 : -1
property real spacing: root.spacing
columnSpacing: spacing
rowSpacing: spacing
}
}