settings app: expandable navrail buttons

This commit is contained in:
end-4
2025-06-18 17:30:18 +02:00
parent afbf6c8ccd
commit 93baba1568
9 changed files with 204 additions and 42 deletions
@@ -11,7 +11,7 @@ RippleButton {
id: root
property string iconText: "add"
property bool expanded: false
property real baseSize: 50
property real baseSize: 56
property real elementSpacing: 5
implicitWidth: Math.max(contentRowLayout.implicitWidth + 10 * 2, baseSize)
implicitHeight: baseSize
@@ -33,23 +33,27 @@ RippleButton {
id: icon
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
iconSize: Appearance.font.pixelSize.huge
iconSize: 24
color: Appearance.colors.colOnLayer1
text: root.iconText
}
Revealer {
visible: root.expanded || implicitWidth > 0
reveal: root.expanded
implicitWidth: reveal ? (buttonText.implicitWidth + root.elementSpacing + contentRowLayout.horizontalMargins) : 0
StyledText {
id: buttonText
anchors {
left: parent.left
leftMargin: root.elementSpacing
Loader {
active: true
sourceComponent: Revealer {
visible: root.expanded || implicitWidth > 0
reveal: root.expanded
implicitWidth: reveal ? (buttonText.implicitWidth + root.elementSpacing + contentRowLayout.horizontalMargins) : 0
StyledText {
id: buttonText
anchors {
left: parent.left
leftMargin: root.elementSpacing
}
text: root.buttonText
color: Appearance.colors.colOnLayer1
font.pixelSize: 14
font.weight: 450
}
text: root.buttonText
color: Appearance.colors.colOnLayer1
font.pixelSize: Appearance.font.pixelSize.small
}
}
}