feat(StatusColorRadioButton): expose radio button diameter property
Issue #5982
This commit is contained in:
parent
737b9cfb3f
commit
5c24767310
|
@ -8,19 +8,21 @@ RadioButton {
|
|||
|
||||
property string radioButtonColor: ""
|
||||
property string selectionColor: StatusColors.colors['white']
|
||||
property int diameter: 48
|
||||
property int selectorDiameter: 20
|
||||
|
||||
implicitWidth: 48
|
||||
implicitHeight: 48
|
||||
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 48
|
||||
implicitHeight: 48
|
||||
implicitWidth: control.diameter
|
||||
implicitHeight: control.diameter
|
||||
radius: width/2
|
||||
color: radioButtonColor
|
||||
|
||||
Rectangle {
|
||||
width: 20
|
||||
height: 20
|
||||
width: control.selectorDiameter
|
||||
height: control.selectorDiameter
|
||||
radius: width/2
|
||||
color: selectionColor
|
||||
border.color: StatusColors.colors['grey3']
|
||||
|
|
|
@ -12,6 +12,9 @@ Column {
|
|||
property alias title: title
|
||||
property alias columns: grid.columns
|
||||
|
||||
property int diameter: 48
|
||||
property int selectorDiameter: 20
|
||||
|
||||
property int selectedColorIndex: 0
|
||||
property string selectedColor: ""
|
||||
property var model:[ StatusColors.colors['black'],
|
||||
|
@ -46,6 +49,10 @@ Column {
|
|||
Repeater {
|
||||
model: root.model
|
||||
delegate: StatusColorRadioButton {
|
||||
implicitWidth: root.diameter
|
||||
implicitHeight: root.diameter
|
||||
diameter: root.diameter
|
||||
selectorDiameter: root.selectorDiameter
|
||||
checked: index === selectedColorIndex
|
||||
radioButtonColor: root.model[index] || "transparent"
|
||||
onCheckedChanged: {
|
||||
|
|
Loading…
Reference in New Issue