From b663020c9a60704dc53014522a3faa23892280a0 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 31 Mar 2016 16:58:08 +0200 Subject: Add RadioDelegate RadioDelegate is an item delegate that is used in lists, and can be checked and unchecked. It derives from QQuickItemDelegate and hence has background press effects. The order of the indicator and text is reversed (compared to RadioButton) to reflect what is most commonly seen on mobile. Change-Id: I143ee9a30cd8ce1d624354f4cb981c41dfddc2d2 Reviewed-by: J-P Nurmi --- src/imports/controls/RadioButton.qml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'src/imports/controls/RadioButton.qml') diff --git a/src/imports/controls/RadioButton.qml b/src/imports/controls/RadioButton.qml index 1c4966e5..fbb75585 100644 --- a/src/imports/controls/RadioButton.qml +++ b/src/imports/controls/RadioButton.qml @@ -53,26 +53,10 @@ T.RadioButton { opacity: enabled ? 1 : 0.2 //! [indicator] - indicator: Rectangle { - implicitWidth: 28 - implicitHeight: 28 + indicator: RadioIndicator { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 - - radius: width / 2 - color: control.pressed ? (control.activeKeyFocus ? "#cce0ff" : "#e4e4e4") : "#f6f6f6" - border.width: control.activeKeyFocus ? 2 : 1 - border.color: control.activeKeyFocus ? "#0066ff" : (control.pressed ? "#26282a" : "#353637") - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 20 - height: 20 - radius: width / 2 - color: parent.border.color - visible: control.checked - } + control: control } //! [indicator] -- cgit v1.2.3