FluentUI/example/T_Buttons.qml

157 lines
4.6 KiB
QML
Raw Normal View History

2023-02-28 18:29:00 +08:00
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
2023-03-06 18:08:01 +08:00
import QtQuick.Controls 2.15
2023-02-28 18:29:00 +08:00
import QtGraphicalEffects 1.15
import FluentUI 1.0
Item {
width: parent.width
2023-03-06 18:08:01 +08:00
FluText{
id:title
text:"Buttons"
fontStyle: FluText.TitleLarge
}
ScrollView{
clip: true
2023-02-28 18:29:00 +08:00
width: parent.width
2023-03-06 18:08:01 +08:00
contentWidth: parent.width
anchors{
top: title.bottom
bottom: parent.bottom
2023-02-28 18:29:00 +08:00
}
2023-03-06 18:08:01 +08:00
ColumnLayout{
spacing: 5
2023-02-28 18:29:00 +08:00
width: parent.width
2023-03-06 18:08:01 +08:00
RowLayout{
Layout.topMargin: 20
width: parent.width
FluButton{
disabled:button_switch.checked
onClicked: {
showInfo("点击StandardButton")
}
2023-02-28 18:29:00 +08:00
}
2023-03-06 18:08:01 +08:00
Item{
height: 1
Layout.fillWidth: true
2023-02-28 18:29:00 +08:00
}
2023-03-06 18:08:01 +08:00
FluToggleSwitch{
id:button_switch
Layout.alignment: Qt.AlignRight
}
FluText{
text:"Disabled"
2023-02-28 18:29:00 +08:00
}
}
2023-03-06 18:08:01 +08:00
FluDivider{
Layout.fillWidth: true ; height:1;
2023-02-28 18:29:00 +08:00
}
2023-03-06 18:08:01 +08:00
RowLayout{
Layout.topMargin: 20
width: parent.width
FluFilledButton{
disabled:filled_button_switch.checked
onClicked:{
showWarning("点击FilledButton")
}
}
Item{
height: 1
Layout.fillWidth: true
}
FluToggleSwitch{
id:filled_button_switch
Layout.alignment: Qt.AlignRight
}
FluText{
text:"Disabled"
}
2023-02-28 18:29:00 +08:00
}
2023-03-06 18:08:01 +08:00
FluDivider{
Layout.fillWidth: true ; height:1
}
RowLayout{
Layout.topMargin: 20
width: parent.width
FluIconButton{
icon:FluentIcons.FA_close
disabled:icon_button_switch.checked
onClicked:{
showSuccess("点击IconButton")
}
}
Item{
height: 1
Layout.fillWidth: true
}
FluToggleSwitch{
id:icon_button_switch
Layout.alignment: Qt.AlignRight
}
FluText{
text:"Disabled"
}
2023-02-28 18:29:00 +08:00
}
2023-03-06 18:08:01 +08:00
FluDivider{
Layout.fillWidth: true ; height:1
}
RowLayout{
Layout.topMargin: 20
width: parent.width
ColumnLayout{
spacing: 8
Repeater{
id:repeater
property int selecIndex : 0
model: 3
delegate: FluRadioButton{
checked : repeater.selecIndex===index
disabled:radio_button_switch.checked
text:"RodioButton_"+index
onClicked:{
repeater.selecIndex = index
}
2023-02-28 18:29:00 +08:00
}
}
}
2023-03-06 18:08:01 +08:00
Item{
height: 1
Layout.fillWidth: true
}
FluToggleSwitch{
id:radio_button_switch
Layout.alignment: Qt.AlignRight
}
FluText{
text:"Disabled"
}
2023-02-28 18:29:00 +08:00
}
2023-03-09 11:50:40 +08:00
FluDivider{
Layout.fillWidth: true ; height:1
}
RowLayout{
Layout.topMargin: 20
width: parent.width
FluCheckBox{
disabled:icon_button_check.checked
}
Item{
height: 1
Layout.fillWidth: true
}
FluToggleSwitch{
id:icon_button_check
Layout.alignment: Qt.AlignRight
}
FluText{
text:"Disabled"
}
}
FluDivider{
Layout.fillWidth: true ; height:1
}
2023-02-28 18:29:00 +08:00
}
}
}