Compare commits

..

1 Commits

Author SHA1 Message Date
gaoxiangyang
74f265dd41
Merge c36515f19c into 2d4e61445e 2024-05-08 12:37:31 +00:00
3 changed files with 4 additions and 64 deletions

View File

@ -22,37 +22,18 @@ FluScrollablePage{
FluGroupBox {
title: qsTr("RadioButton Group")
Layout.fillWidth: true
Layout.preferredHeight: 150
Layout.topMargin: 20
FluRadioButtons {
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
spacing: 10
disabled: radio_button_switch.checked
FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") }
}
FluToggleSwitch{
id: radio_button_switch
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Disabled")
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: 4
code:`
FluGroupBox {
code:'FluGroupBox {
title: qsTr("CheckBox Group")
ColumnLayout {
spacing: 10
@ -61,20 +42,7 @@ FluGroupBox {
FluCheckBox { text: qsTr("Calendar") }
FluCheckBox { text: qsTr("Contacts") }
}
}
FluGroupBox {
title: qsTr("RadioButton Group")
FluRadioButtons {
spacing: 10
disabled: true // FluRadioButton
manuallyDisabled: true // FluRadioButtondisabled
FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") }
}
}
`
}'
}
}

View File

@ -6,8 +6,6 @@ import FluentUI 1.0
ColumnLayout {
default property alias buttons: control.data
property int currentIndex : -1
property bool disabled: false
property bool manuallyDisabled: false
id:control
onCurrentIndexChanged: {
for(var i = 0;i<buttons.length;i++){
@ -18,12 +16,6 @@ ColumnLayout {
button.checked = true
}
}
onDisabledChanged: {
refreshButtonStatus()
}
onManuallyDisabledChanged: {
refreshButtonStatus()
}
Component.onCompleted: {
for(var i = 0;i<buttons.length;i++){
buttons[i].clickListener = function(){
@ -35,12 +27,6 @@ ColumnLayout {
}
}
}
refreshButtonStatus()
}
function refreshButtonStatus() {
for(var i = 0;i<buttons.length;i++){
if(!manuallyDisabled) buttons[i].enabled = !disabled
}
currentIndex = 0
}
}

View File

@ -7,8 +7,6 @@ import FluentUI
ColumnLayout {
default property alias buttons: control.data
property int currentIndex : -1
property bool disabled: false
property bool manuallyDisabled: false
id:control
onCurrentIndexChanged: {
for(var i = 0;i<buttons.length;i++){
@ -19,12 +17,6 @@ ColumnLayout {
button.checked = true
}
}
onDisabledChanged: {
refreshButtonStatus()
}
onManuallyDisabledChanged: {
refreshButtonStatus()
}
Component.onCompleted: {
for(var i = 0;i<buttons.length;i++){
buttons[i].clickListener = function(){
@ -36,12 +28,6 @@ ColumnLayout {
}
}
}
refreshButtonStatus()
}
function refreshButtonStatus() {
for(var i = 0;i<buttons.length;i++){
if(!manuallyDisabled) buttons[i].enabled = !disabled
}
currentIndex = 0
}
}