refractor sidebar toggles group

This commit is contained in:
end-4
2025-05-24 18:02:14 +02:00
parent fce4709d63
commit b11050a231
4 changed files with 145 additions and 32 deletions
@@ -6,23 +6,17 @@ import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Io
RippleButton {
GroupButton {
id: button
rippleEnabled: false
property string buttonIcon
property int clickIndex: parent?.clickIndex ?? -1
baseWidth: 40
baseHeight: 40
clickedWidth: 60
clickedHeight: 40
toggled: false
buttonRadius: Appearance?.rounding?.full
buttonRadius: Math.min(baseHeight, baseWidth) / 2
buttonRadiusPressed: Appearance?.rounding?.small
Layout.fillWidth: (clickIndex - 1 <= parent.children.indexOf(button) && parent.children.indexOf(button) <= clickIndex + 1)
implicitWidth: button.down ? 60 : 40
implicitHeight: 40
Behavior on implicitWidth {
animation: Appearance.animation.clickBounce.numberAnimation.createObject(this)
}
onDownChanged: {
if (button.down) {
if (button.parent.clickIndex !== undefined) {