sidebar: android-style quick toggles & sliders (#2217)

Co-Authored-By: Vague Syntax <173799252+vaguesyntax@users.noreply.github.com>
This commit is contained in:
end-4
2025-10-18 19:07:10 +02:00
parent 77ae119d32
commit 5d1a9b1e9c
35 changed files with 1895 additions and 90 deletions
@@ -22,13 +22,15 @@ Button {
property bool bounce: true
property real baseWidth: contentItem.implicitWidth + horizontalPadding * 2
property real baseHeight: contentItem.implicitHeight + verticalPadding * 2
property real clickedWidth: baseWidth + 20
property real clickedWidth: baseWidth + (isAtSide ? 10 : 20)
property real clickedHeight: baseHeight
property var parentGroup: root.parent
property int indexInParent: parentGroup?.children.indexOf(root) ?? 0
property int clickIndex: parentGroup?.clickIndex ?? -1
property bool isAtSide: indexInParent === 0 || indexInParent === (parentGroup?.childrenCount - 1)
Layout.fillWidth: (clickIndex - 1 <= parentGroup?.children.indexOf(root) && parentGroup?.children.indexOf(root) <= clickIndex + 1)
Layout.fillHeight: (clickIndex - 1 <= parentGroup?.children.indexOf(root) && parentGroup?.children.indexOf(root) <= clickIndex + 1)
Layout.fillWidth: (clickIndex - 1 <= indexInParent && indexInParent <= clickIndex + 1)
Layout.fillHeight: (clickIndex - 1 <= indexInParent && indexInParent <= clickIndex + 1)
implicitWidth: (root.down && bounce) ? clickedWidth : baseWidth
implicitHeight: (root.down && bounce) ? clickedHeight : baseHeight