main
朱子楚\zhuzi 2023-04-05 17:48:17 +08:00
parent 64fa2b6370
commit 6de1b9d78f
3 changed files with 120 additions and 8 deletions

View File

@ -3,15 +3,15 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Buttons" title:"Buttons"
spacing: 20
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluText{ FluText{
Layout.topMargin: 20 Layout.topMargin: 20
@ -22,6 +22,7 @@ FluScrollablePage{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 height: 68
paddings: 10 paddings: 10
Layout.topMargin: 20
FluTextButton{ FluTextButton{
disabled:text_button_switch.selected disabled:text_button_switch.selected
@ -48,11 +49,21 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluTextButton{
text:"Text Button"
onClicked: {
}
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 height: 68
paddings: 10 paddings: 10
Layout.topMargin: 20
FluButton{ FluButton{
disabled:button_switch.selected disabled:button_switch.selected
@ -79,10 +90,20 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluButton{
text:"Standard Button"
onClicked: {
}
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 height: 68
Layout.topMargin: 20
paddings: 10 paddings: 10
FluFilledButton{ FluFilledButton{
@ -110,13 +131,22 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluFilledButton{
text:"Filled Button"
onClicked: {
}
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 height: 68
paddings: 10 paddings: 10
Layout.topMargin: 20
FluIconButton{ FluIconButton{
iconSource:FluentIcons.ChromeCloseContrast iconSource:FluentIcons.ChromeCloseContrast
disabled:icon_button_switch.selected disabled:icon_button_switch.selected
@ -143,12 +173,21 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluIconButton{
iconSource:FluentIcons.ChromeCloseContrast
onClicked: {
}
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 height: 68
paddings: 10 paddings: 10
Layout.topMargin: 20
FluDropDownButton{ FluDropDownButton{
disabled:drop_down_button_switch.selected disabled:drop_down_button_switch.selected
text:"DropDownButton" text:"DropDownButton"
@ -184,12 +223,32 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluDropDownButton{
text:"DropDownButton"
items:[
FluMenuItem{
text:"Menu_1"
},
FluMenuItem{
text:"Menu_2"
},
FluMenuItem{
text:"Menu_3"
},
FluMenuItem{
text:"Menu_4"
}
]
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 100 height: 100
paddings: 10 paddings: 10
Layout.topMargin: 20
ColumnLayout{ ColumnLayout{
spacing: 8 spacing: 8
anchors{ anchors{
@ -225,13 +284,23 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluRadioButton{
selected:true
text:"Text Button"
onClicked: {
}
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 height: 68
paddings: 10 paddings: 10
Layout.topMargin: 20
FluCheckBox{ FluCheckBox{
disabled:check_box_switch.selected disabled:check_box_switch.selected
text:"Check Box" text:"Check Box"
@ -240,8 +309,6 @@ FluScrollablePage{
left: parent.left left: parent.left
} }
} }
Row{ Row{
spacing: 5 spacing: 5
anchors{ anchors{
@ -255,4 +322,10 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluCheckBox{
text:"Check Box"
}'
}
} }

View File

@ -0,0 +1,38 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import FluentUI
FluExpander{
property string code: ""
headerText: "Source"
contentHeight:content.height
FluMultilineTextBox{
id:content
width:parent.width
readOnly:true
text:code
background:Rectangle{
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
}
}
FluIconButton{
iconSource:FluentIcons.Copy
anchors{
right: parent.right
top: parent.top
rightMargin: 5
topMargin: 5
}
onClicked:{
FluApp.clipText(content.text)
showSuccess("复制成功")
}
}
}

View File

@ -155,5 +155,6 @@
<file>page/MediaPage.qml</file> <file>page/MediaPage.qml</file>
<file>T_FlipView.qml</file> <file>T_FlipView.qml</file>
<file>T_Pivot.qml</file> <file>T_Pivot.qml</file>
<file>component/CodeExpander.qml</file>
</qresource> </qresource>
</RCC> </RCC>