diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-15 21:55:10 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-15 21:55:10 +1000 |
| commit | 7a9fce9dd417db42d75dc80a86df45ed0402d6d4 (patch) | |
| tree | 1a3671200433275f017073e70e895971bfd94951 /components/controls/SplitButton.qml | |
| parent | utilities/record: select mode (diff) | |
| download | caelestia-shell-7a9fce9dd417db42d75dc80a86df45ed0402d6d4.tar.gz caelestia-shell-7a9fce9dd417db42d75dc80a86df45ed0402d6d4.tar.bz2 caelestia-shell-7a9fce9dd417db42d75dc80a86df45ed0402d6d4.zip | |
utilities/record: allow pause/resume recording
Diffstat (limited to 'components/controls/SplitButton.qml')
| -rw-r--r-- | components/controls/SplitButton.qml | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/components/controls/SplitButton.qml b/components/controls/SplitButton.qml index 6c92285..a61a536 100644 --- a/components/controls/SplitButton.qml +++ b/components/controls/SplitButton.qml @@ -15,6 +15,7 @@ Row { property real horizontalPadding: Appearance.padding.normal property real verticalPadding: Appearance.padding.smaller property int type: SplitButton.Filled + property bool disabled property alias menuItems: menu.items property alias active: menu.active property alias expanded: menu.expanded @@ -22,6 +23,8 @@ Row { property color colour: type == SplitButton.Filled ? Colours.palette.m3primary : Colours.palette.m3secondaryContainer property color textColour: type == SplitButton.Filled ? Colours.palette.m3onPrimary : Colours.palette.m3onSecondaryContainer + readonly property color disabledColour: Qt.alpha(Colours.palette.m3onSurface, 0.1) + readonly property color disabledTextColour: Qt.alpha(Colours.palette.m3onSurface, 0.38) spacing: Math.floor(Appearance.spacing.small / 2) @@ -29,7 +32,7 @@ Row { radius: implicitHeight / 2 topRightRadius: Appearance.rounding.small / 2 bottomRightRadius: Appearance.rounding.small / 2 - color: root.colour + color: root.disabled ? root.disabledColour : root.colour implicitWidth: textRow.implicitWidth + root.horizontalPadding * 2 implicitHeight: expandBtn.implicitHeight @@ -40,6 +43,7 @@ Row { rect.topRightRadius: parent.topRightRadius rect.bottomRightRadius: parent.bottomRightRadius color: root.textColour + disabled: root.disabled function onClicked(): void { root.active?.clicked(); @@ -59,7 +63,7 @@ Row { Layout.alignment: Qt.AlignVCenter animate: true text: root.active?.activeIcon ?? "" - color: root.textColour + color: root.disabled ? root.disabledTextColour : root.textColour fill: 1 } @@ -70,7 +74,7 @@ Row { Layout.preferredWidth: implicitWidth animate: true text: root.active?.activeText ?? "" - color: root.textColour + color: root.disabled ? root.disabledTextColour : root.textColour clip: true Behavior on Layout.preferredWidth { @@ -90,7 +94,7 @@ Row { radius: implicitHeight / 2 topLeftRadius: rad bottomLeftRadius: rad - color: root.colour + color: root.disabled ? root.disabledColour : root.colour implicitWidth: implicitHeight implicitHeight: expandIcon.implicitHeight + root.verticalPadding * 2 @@ -101,6 +105,7 @@ Row { rect.topRightRadius: parent.topRightRadius rect.bottomRightRadius: parent.bottomRightRadius color: root.textColour + disabled: root.disabled function onClicked(): void { root.expanded = !root.expanded; @@ -114,7 +119,7 @@ Row { anchors.horizontalCenterOffset: root.expanded ? 0 : -Math.floor(root.verticalPadding / 4) text: "expand_more" - color: root.textColour + color: root.disabled ? root.disabledTextColour : root.textColour rotation: root.expanded ? 180 : 0 Behavior on anchors.horizontalCenterOffset { |