diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-23 23:16:17 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-23 23:16:17 +1000 |
| commit | 06f366e27eb7b54567a3e8f74d6ccf89977876c7 (patch) | |
| tree | e0e778de96e558f33865a226c887a53b157ae7db /components/controls/IconButton.qml | |
| parent | readme: update with new configs (diff) | |
| download | caelestia-shell-06f366e27eb7b54567a3e8f74d6ccf89977876c7.tar.gz caelestia-shell-06f366e27eb7b54567a3e8f74d6ccf89977876c7.tar.bz2 caelestia-shell-06f366e27eb7b54567a3e8f74d6ccf89977876c7.zip | |
dashboard/media: improve ui
Diffstat (limited to '')
| -rw-r--r-- | components/controls/IconButton.qml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/controls/IconButton.qml b/components/controls/IconButton.qml index 590cd7d..dc3b04b 100644 --- a/components/controls/IconButton.qml +++ b/components/controls/IconButton.qml @@ -18,6 +18,7 @@ StyledRect { property real padding: type === IconButton.Text ? Appearance.padding.small / 2 : Appearance.padding.smaller property alias font: label.font property int type: IconButton.Filled + property bool disabled property alias stateLayer: stateLayer property alias label: label @@ -36,13 +37,15 @@ StyledRect { return Colours.palette.m3onPrimary; return type === IconButton.Tonal ? Colours.palette.m3onSecondaryContainer : Colours.palette.m3onSurfaceVariant; } + property color disabledColour: Qt.alpha(Colours.palette.m3onSurface, 0.1) + property color disabledOnColour: Qt.alpha(Colours.palette.m3onSurface, 0.38) signal clicked onCheckedChanged: internalChecked = checked radius: internalChecked ? Appearance.rounding.small : implicitHeight / 2 - color: type === IconButton.Text ? "transparent" : internalChecked ? activeColour : inactiveColour + color: type === IconButton.Text ? "transparent" : disabled ? disabledColour : internalChecked ? activeColour : inactiveColour implicitWidth: implicitHeight implicitHeight: label.implicitHeight + padding * 2 @@ -51,6 +54,7 @@ StyledRect { id: stateLayer color: root.internalChecked ? root.activeOnColour : root.inactiveOnColour + disabled: root.disabled function onClicked(): void { if (root.toggle) @@ -63,7 +67,7 @@ StyledRect { id: label anchors.centerIn: parent - color: root.internalChecked ? root.activeOnColour : root.inactiveOnColour + color: root.disabled ? root.disabledOnColour : root.internalChecked ? root.activeOnColour : root.inactiveOnColour fill: !root.toggle || root.internalChecked ? 1 : 0 Behavior on fill { |