| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- import QtQuick
- import QtQuick.Layouts
- import QtQuick.Window
- import QtQuick.Controls
- import QtQuick.Controls.Basic
- import FluentUI
- import "../component"
- FluScrollablePage{
- title:"Buttons"
- leftPadding:10
- rightPadding:10
- bottomPadding:20
- spacing: 0
- FluText{
- Layout.topMargin: 20
- text:"支持Tab键切换焦点,空格键执行点击事件"
- }
- FluArea{
- Layout.fillWidth: true
- height: 68
- paddings: 10
- Layout.topMargin: 20
- FluTextButton{
- disabled:text_button_switch.selected
- text:"Text Button"
- onClicked: {
- showInfo("点击Text Button")
- }
- anchors{
- verticalCenter: parent.verticalCenter
- left: parent.left
- }
- }
- Row{
- spacing: 5
- anchors{
- verticalCenter: parent.verticalCenter
- right: parent.right
- }
- FluToggleSwitch{
- id:text_button_switch
- Layout.alignment: Qt.AlignRight
- text:"Disabled"
- }
- }
- }
- CodeExpander{
- Layout.fillWidth: true
- Layout.topMargin: -1
- code:'FluTextButton{
- text:"Text Button"
- onClicked: {
- }
- }'
- }
- FluArea{
- Layout.fillWidth: true
- height: 68
- paddings: 10
- Layout.topMargin: 20
- FluButton{
- disabled:button_switch.selected
- text:"Standard Button"
- onClicked: {
- showInfo("点击StandardButton")
- }
- anchors{
- verticalCenter: parent.verticalCenter
- left: parent.left
- }
- }
- Row{
- spacing: 5
- anchors{
- verticalCenter: parent.verticalCenter
- right: parent.right
- }
- FluToggleSwitch{
- id:button_switch
- Layout.alignment: Qt.AlignRight
- text:"Disabled"
- }
- }
- }
- CodeExpander{
- Layout.fillWidth: true
- Layout.topMargin: -1
- code:'FluButton{
- text:"Standard Button"
- onClicked: {
- }
- }'
- }
- FluArea{
- Layout.fillWidth: true
- height: 68
- Layout.topMargin: 20
- paddings: 10
- FluFilledButton{
- disabled:filled_button_switch.selected
- text:"Filled Button"
- onClicked: {
- showWarning("点击FilledButton")
- }
- anchors{
- verticalCenter: parent.verticalCenter
- left: parent.left
- }
- }
- Row{
- spacing: 5
- anchors{
- verticalCenter: parent.verticalCenter
- right: parent.right
- }
- FluToggleSwitch{
- id:filled_button_switch
- Layout.alignment: Qt.AlignRight
- text:"Disabled"
- }
- }
- }
- CodeExpander{
- Layout.fillWidth: true
- Layout.topMargin: -1
- code:'FluFilledButton{
- text:"Filled Button"
- onClicked: {
- }
- }'
- }
- FluArea{
- Layout.fillWidth: true
- height: 68
- Layout.topMargin: 20
- paddings: 10
- FluToggleButton{
- disabled:toggle_button_switch.selected
- text:"Toggle Button"
- onClicked: {
- selected = !selected
- }
- anchors{
- verticalCenter: parent.verticalCenter
- left: parent.left
- }
- }
- Row{
- spacing: 5
- anchors{
- verticalCenter: parent.verticalCenter
- right: parent.right
- }
- FluToggleSwitch{
- id:toggle_button_switch
- Layout.alignment: Qt.AlignRight
- text:"Disabled"
- }
- }
- }
- CodeExpander{
- Layout.fillWidth: true
- Layout.topMargin: -1
- code:'FluToggleButton{
- text:"Toggle Button"
- onClicked: {
- selected = !selected
- }
- }'
- }
- FluArea{
- Layout.fillWidth: true
- height: 68
- paddings: 10
- Layout.topMargin: 20
- FluIconButton{
- iconSource:FluentIcons.ChromeCloseContrast
- disabled:icon_button_switch.selected
- iconSize: 15
- anchors{
- verticalCenter: parent.verticalCenter
- left: parent.left
- }
- onClicked:{
- showSuccess("点击IconButton")
- }
- }
- Row{
- spacing: 5
- anchors{
- verticalCenter: parent.verticalCenter
- right: parent.right
- }
- FluToggleSwitch{
- id:icon_button_switch
- Layout.alignment: Qt.AlignRight
- text:"Disabled"
- }
- }
- }
- CodeExpander{
- Layout.fillWidth: true
- Layout.topMargin: -1
- code:'FluIconButton{
- iconSource:FluentIcons.ChromeCloseContrast
- onClicked: {
- }
- }'
- }
- FluArea{
- Layout.fillWidth: true
- height: 68
- paddings: 10
- Layout.topMargin: 20
- FluDropDownButton{
- disabled:drop_down_button_switch.selected
- text:"DropDownButton"
- anchors{
- verticalCenter: parent.verticalCenter
- left: parent.left
- }
- items:[
- FluMenuItem{
- text:"Menu_1"
- },
- FluMenuItem{
- text:"Menu_2"
- },
- FluMenuItem{
- text:"Menu_3"
- },
- FluMenuItem{
- text:"Menu_4"
- }
- ]
- }
- Row{
- spacing: 5
- anchors{
- verticalCenter: parent.verticalCenter
- right: parent.right
- }
- FluToggleSwitch{
- id:drop_down_button_switch
- Layout.alignment: Qt.AlignRight
- text:"Disabled"
- }
- }
- }
- CodeExpander{
- Layout.fillWidth: true
- Layout.topMargin: -1
- code:'FluDropDownButton{
- text:"DropDownButton"
- items:[
- FluMenuItem{
- text:"Menu_1"
- },
- FluMenuItem{
- text:"Menu_2"
- },
- FluMenuItem{
- text:"Menu_3"
- },
- FluMenuItem{
- text:"Menu_4"
- }
- ]
- }'
- }
- FluArea{
- Layout.fillWidth: true
- height: 100
- paddings: 10
- Layout.topMargin: 20
- ColumnLayout{
- spacing: 8
- anchors{
- verticalCenter: parent.verticalCenter
- left: parent.left
- }
- Repeater{
- id:repeater
- property int selecIndex : 0
- model: 3
- delegate: FluRadioButton{
- selected : repeater.selecIndex===index
- disabled:radio_button_switch.selected
- text:"Radio Button_"+index
- onClicked:{
- repeater.selecIndex = index
- }
- }
- }
- }
- Row{
- spacing: 5
- anchors{
- verticalCenter: parent.verticalCenter
- right: parent.right
- }
- FluToggleSwitch{
- id:radio_button_switch
- Layout.alignment: Qt.AlignRight
- text:"Disabled"
- }
- }
- }
- CodeExpander{
- Layout.fillWidth: true
- Layout.topMargin: -1
- code:'FluRadioButton{
- selected:true
- text:"Text Button"
- onClicked: {
- }
- }'
- }
- FluArea{
- Layout.fillWidth: true
- height: 68
- paddings: 10
- Layout.topMargin: 20
- FluCheckBox{
- disabled:check_box_switch.selected
- text:"Check Box"
- anchors{
- verticalCenter: parent.verticalCenter
- left: parent.left
- }
- }
- Row{
- spacing: 5
- anchors{
- verticalCenter: parent.verticalCenter
- right: parent.right
- }
- FluToggleSwitch{
- id:check_box_switch
- Layout.alignment: Qt.AlignRight
- text:"Disabled"
- }
- }
- }
- CodeExpander{
- Layout.fillWidth: true
- Layout.topMargin: -1
- code:'FluCheckBox{
- text:"Check Box"
- }'
- }
- }
|