aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/impl/RadioIndicator.qml
diff options
context:
space:
mode:
authorTarja Sundqvist <[email protected]>2025-06-03 13:43:35 +0300
committerTarja Sundqvist <[email protected]>2025-06-03 13:43:35 +0300
commit0f0972d542d9869c2dcfaf9c963d42ff32766460 (patch)
treef283360ffbf0453e04a321e01f0c3df1c07df3e3 /src/quickcontrols/material/impl/RadioIndicator.qml
parent07e23b0f4983631524716f034c0268fd11d037f9 (diff)
parentff0a47c8f267e905113b82c53af2742027f0eca6 (diff)
Merge tag 'v6.5.6-lts-lgpl' into 6.56.5
Qt 6.5.6-lts-lgpl release
Diffstat (limited to 'src/quickcontrols/material/impl/RadioIndicator.qml')
-rw-r--r--src/quickcontrols/material/impl/RadioIndicator.qml31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/quickcontrols/material/impl/RadioIndicator.qml b/src/quickcontrols/material/impl/RadioIndicator.qml
index 9570065692..2cf46a69cb 100644
--- a/src/quickcontrols/material/impl/RadioIndicator.qml
+++ b/src/quickcontrols/material/impl/RadioIndicator.qml
@@ -12,19 +12,42 @@ Rectangle {
implicitHeight: 20
radius: width / 2
border.width: 2
- border.color: !control.enabled ? control.Material.hintTextColor
- : control.checked || control.down ? control.Material.accentColor : control.Material.secondaryTextColor
+ border.color: targetColor
color: "transparent"
+ // Store the target color in a separate property, because there are two animations that depend on it.
+ readonly property color targetColor: !control.enabled ? control.Material.hintTextColor
+ : control.checked || control.down ? control.Material.accentColor : control.Material.secondaryTextColor
+
property T.AbstractButton control
+ Behavior on border.color {
+ ColorAnimation {
+ duration: 100
+ easing.type: Easing.OutCubic
+ }
+ }
+
Rectangle {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: 10
height: 10
radius: width / 2
- color: parent.border.color
- visible: indicator.control.checked || indicator.control.down
+ color: indicator.targetColor
+ scale: indicator.control.checked || indicator.control.down ? 1 : 0
+
+ Behavior on color {
+ ColorAnimation {
+ duration: 100
+ easing.type: Easing.OutCubic
+ }
+ }
+
+ Behavior on scale {
+ NumberAnimation {
+ duration: 100
+ }
+ }
}
}