This commit is contained in:
zhuzihcu 2023-04-06 17:32:21 +08:00
parent 13abd275b4
commit d89aaec062
28 changed files with 1044 additions and 462 deletions

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -11,6 +12,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -99,5 +101,19 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
count: 100
isDot: false
color: Qt.rgba(82/255,196/255,26/255,1)
}
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -19,6 +21,12 @@ FluScrollablePage{
FluCalendarView{ FluCalendarView{
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluCalendarView{
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -34,5 +42,11 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluCalendarPicker{
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -35,4 +37,14 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluCarousel{
width: 400
height: 300
Component.onCompleted: {
setData([{url:"qrc:/res/image/banner_1.jpg"},{url:"qrc:/res/image/banner_2.jpg"},{url:"qrc:/res/image/banner_3.jpg"}])
}
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -37,6 +39,12 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluColorView{
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -54,6 +62,12 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluColorPicker{
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,44 +11,42 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 80 height: 80
paddings: 10 paddings: 10
ColumnLayout{ ColumnLayout{
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left left: parent.left
} }
FluText{ FluText{
text:"showYear=true" text:"showYear=true"
} }
FluDatePicker{ FluDatePicker{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluDatePicker{
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 80 height: 80
paddings: 10 paddings: 10
ColumnLayout{ ColumnLayout{
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left left: parent.left
} }
FluText{ FluText{
text:"showYear=false" text:"showYear=false"
} }
@ -56,8 +55,13 @@ FluScrollablePage{
showYear:false showYear:false
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluDatePicker{
showYear:false
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,40 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
FluButton{
anchors.verticalCenter: parent.verticalCenter
Layout.topMargin: 20
text:"Show Dialog"
onClicked: {
dialog.open()
}
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluContentDialog{
id:dialog
title:"友情提示"
message:"确定要退出程序么?"
negativeText:"取消"
onNegativeClicked:{
showSuccess("点击取消按钮")
}
positiveText:"确定"
onPositiveClicked:{
showSuccess("点击确定按钮")
}
}
dialog.open()
'
}
FluContentDialog{ FluContentDialog{
id:dialog id:dialog
@ -25,11 +60,5 @@ FluScrollablePage{
} }
} }
FluButton{
Layout.topMargin: 20
text:"Show Dialog"
onClicked: {
dialog.open()
}
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,20 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
height: layout_column.height+40
paddings: 10
Layout.topMargin: 20
Column{
id:layout_column
spacing: 15
anchors{
verticalCenter: parent.verticalCenter
left:parent.left
}
FluExpander{ FluExpander{
headerText:"打开一个单选框" headerText:"打开一个单选框"
@ -62,4 +77,33 @@ FluScrollablePage{
} }
} }
} }
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluExpander{
headerText:"打开一个单选框"
Item{
anchors.fill: parent
Flickable{
width: parent.width
height: parent.height
contentWidth: width
contentHeight: text_info.height
ScrollBar.vertical: FluScrollBar {}
FluText{
id:text_info
width: scrollview.width
wrapMode: Text.WrapAnywhere
padding: 14
text:"先帝创业未半而中道崩殂,今天下三分......""
}
}
}
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,7 +11,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -26,7 +27,6 @@ FluScrollablePage{
Image{ Image{
source: "qrc:/res/image/banner_1.jpg" source: "qrc:/res/image/banner_1.jpg"
asynchronous: true asynchronous: true
sourceSize: Qt.size(400,300)
fillMode:Image.PreserveAspectCrop fillMode:Image.PreserveAspectCrop
} }
Image{ Image{
@ -42,6 +42,27 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluFlipView{
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
}
'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -74,5 +95,26 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluFlipView{
vertical:true
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
}
'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,33 +11,53 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
height: 200
paddings: 10
ColumnLayout{
spacing: 14
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
FluButton{ FluButton{
text:"Info" text:"Info"
Layout.topMargin: 20
onClicked: { onClicked: {
showInfo("这是一个Info样式的InfoBar") showInfo("这是一个Info样式的InfoBar")
} }
} }
FluButton{ FluButton{
text:"Warning" text:"Warning"
Layout.topMargin: 20
onClicked: { onClicked: {
showWarning("这是一个Warning样式的InfoBar") showWarning("这是一个Warning样式的InfoBar")
} }
} }
FluButton{ FluButton{
text:"Error" text:"Error"
Layout.topMargin: 20
onClicked: { onClicked: {
showError("这是一个Error样式的InfoBar") showError("这是一个Error样式的InfoBar")
} }
} }
FluButton{ FluButton{
text:"Success" text:"Success"
Layout.topMargin: 20
onClicked: { onClicked: {
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar") showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
} }
} }
}
}
CodeExpander{
Layout.fillWidth: true
code:' showInfo("这是一个Info样式的InfoBar")
showWarning("这是一个Warning样式的InfoBar")
showError("这是一个Error样式的InfoBar")
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
onVisibleChanged: { onVisibleChanged: {
if(visible){ if(visible){
@ -18,7 +20,6 @@ FluScrollablePage{
player.pause() player.pause()
} }
} }
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 320 height: 320
@ -35,13 +36,19 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluMediaPlayer{
id:player
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
}
'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 height: 68
Layout.topMargin: 20 Layout.topMargin: 20
paddings: 10 paddings: 10
FluButton{ FluButton{
text:"跳转到视频播放器窗口" text:"跳转到视频播放器窗口"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -49,8 +56,10 @@ FluScrollablePage{
FluApp.navigate("/media",{source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"}) FluApp.navigate("/media",{source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"})
} }
} }
} }
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,20 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.topMargin: 20
Column{
id:layout_column
spacing: 15
anchors{
verticalCenter: parent.verticalCenter
left:parent.left
}
FluButton{ FluButton{
text:"左击菜单" text:"左击菜单"
@ -19,7 +34,6 @@ FluScrollablePage{
} }
} }
FluButton{ FluButton{
text:"右击菜单" text:"右击菜单"
Layout.topMargin: 20 Layout.topMargin: 20
@ -34,6 +48,29 @@ FluScrollablePage{
} }
} }
} }
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluMenu{
id:menu
FluMenuItem:{
text:"删除"
onClicked: {
showError("删除")
}
}
FluMenuItem:{
text:"修改"
onClicked: {
showInfo"修改")
}
}
}
menu.popup()
'
}
FluMenu{ FluMenu{
id:menu id:menu
@ -46,7 +83,7 @@ FluScrollablePage{
FluMenuItem{ FluMenuItem{
text:"修改" text:"修改"
onClicked: { onClicked: {
showError("修改") showInfo("修改")
} }
} }
} }

View File

@ -3,17 +3,18 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
property string password: ""
property var loginPageRegister: registerForPageResult("/login")
title:"MultiWindow" title:"MultiWindow"
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
property string password: ""
property var loginPageRegister: registerForPageResult("/login")
Connections{ Connections{
target: loginPageRegister target: loginPageRegister
@ -28,7 +29,6 @@ FluScrollablePage{
height: 100 height: 100
paddings: 10 paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
Column{ Column{
spacing: 15 spacing: 15
anchors{ anchors{
@ -46,6 +46,16 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluButton{
text:"点击跳转"
onClicked: {
FluApp.navigate("/about")
}
}
'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -68,11 +78,30 @@ FluScrollablePage{
loginPageRegister.launch({username:"zhuzichu"}) loginPageRegister.launch({username:"zhuzichu"})
} }
} }
FluText{ FluText{
text:"登录窗口返回过来的密码->"+password text:"登录窗口返回过来的密码->"+password
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'property var loginPageRegister: registerForPageResult("/login")
Connections{
target: loginPageRegister
function onResult(data)
{
password = data.password
}
}
FluButton{
text:"点击跳转"
onClicked: {
loginPageRegister.launch({username:"zhuzichu"})
}
}
'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,7 +11,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -46,6 +47,36 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluPivot{
anchors.fill: parent
FluPivotItem:{
text:"All"
contentItem: FluText{
text:"All emails go here."
}
}
FluPivotItem:{
text:"Unread"
contentItem: FluText{
text:"Unread emails go here."
}
}
FluPivotItem:{
text:"Flagged"
contentItem: FluText{
text:"Flagged emails go here."
}
}
FluPivotItem:{
text:"Urgent"
contentItem: FluText{
text:"Urgent emails go here."
}
}
}
'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,30 +11,59 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluProgressBar{ FluArea{
Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 260
paddings: 10
ColumnLayout{
spacing: 20
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
FluProgressBar{
} }
FluProgressRing{ FluProgressRing{
Layout.topMargin: 10
} }
FluProgressBar{ FluProgressBar{
id:progress_bar id:progress_bar
Layout.topMargin: 20
indeterminate: false indeterminate: false
} }
FluProgressRing{ FluProgressRing{
id:progress_ring id:progress_ring
Layout.topMargin: 10
indeterminate: false indeterminate: false
} }
FluSlider{ FluSlider{
Layout.topMargin: 30
value:50 value:50
onValueChanged:{ onValueChanged:{
progress_bar.progress = value/100 progress_bar.progress = value/100
progress_ring.progress = value/100 progress_ring.progress = value/100
} }
Layout.bottomMargin: 30
} }
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluProgressBar{
}
FluProgressRing{
}
FluProgressBar{
indeterminate: false
}
FluProgressRing{
indeterminate: false
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,20 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
height: 480
paddings: 10
Column{
spacing: 15
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
RowLayout{ RowLayout{
Layout.topMargin: 20 Layout.topMargin: 20
@ -114,4 +129,23 @@ FluScrollablePage{
} }
Layout.topMargin: 10 Layout.topMargin: 10
} }
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluRectangle{
radius: [25,25,25,25]
width: 50
height: 50
Image{
asynchronous: true
anchors.fill: parent
source: "qrc:/res/svg/avatar_4.svg"
sourceSize: Qt.size(width,height)
}
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green] property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
@ -99,7 +101,7 @@ FluScrollablePage{
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 5 Layout.topMargin: 15
height: 400 height: 400
paddings: 10 paddings: 10
FluTabView{ FluTabView{
@ -109,5 +111,27 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluTabView{
anchors.fill: parent
Component.onCompleted: {
newTab()
newTab()
newTab()
}
Component{
id:com_page
Rectangle{
anchors.fill: parent
color: argument
}
}
function newTab(){
tab_view.appendTab("qrc:/res/image/favicon.ico","Document 1",com_page,argument)
}
}
'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,32 +11,122 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
FluTextBox{ FluTextBox{
Layout.topMargin: 20 Layout.topMargin: 20
placeholderText: "单行输入框" placeholderText: "单行输入框"
Layout.preferredWidth: 300 Layout.preferredWidth: 300
disabled:toggle_switch.selected disabled:text_box_switch.selected
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
} }
FluMultilineTextBox{
Layout.topMargin: 20
Layout.preferredWidth: 300
placeholderText: "多行输入框"
disabled:toggle_switch.selected
}
FluAutoSuggestBox{
Layout.topMargin: 20
items:generateRandomNames(100)
placeholderText: "AutoSuggestBox"
Layout.preferredWidth: 300
disabled:toggle_switch.selected
} }
FluToggleSwitch{ Row{
id:toggle_switch spacing: 5
text:"Disabled" anchors{
Layout.topMargin: 20 verticalCenter: parent.verticalCenter
right: parent.right
} }
FluToggleSwitch{
id:text_box_switch
Layout.alignment: Qt.AlignRight
text:"Disabled"
}
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluTextBox{
placeholderText:"单行输入框"
}'
}
FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
FluMultilineTextBox{
Layout.topMargin: 20
placeholderText: "多行输入框"
Layout.preferredWidth: 300
disabled:text_box_multi_switch.selected
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
}
Row{
spacing: 5
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
}
FluToggleSwitch{
id:text_box_multi_switch
Layout.alignment: Qt.AlignRight
text:"Disabled"
}
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluMultilineTextBox{
placeholderText:"多行输入框"
}'
}
FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
FluAutoSuggestBox{
Layout.topMargin: 20
placeholderText: "AutoSuggestBox"
Layout.preferredWidth: 300
items:generateRandomNames(100)
disabled:text_box_suggest_switch.selected
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
}
Row{
spacing: 5
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
}
FluToggleSwitch{
id:text_box_suggest_switch
Layout.alignment: Qt.AlignRight
text:"Disabled"
}
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluAutoSuggestBox{
placeholderText:"AutoSuggestBox"
}'
}
function generateRandomNames(numNames) { function generateRandomNames(numNames) {
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,9 +11,20 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
RowLayout{ FluArea{
Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 210
paddings: 10
ColumnLayout{
spacing:0
anchors{
left: parent.left
}
RowLayout{
Layout.topMargin: 10
Repeater{ Repeater{
model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green] model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
delegate: FluRectangle{ delegate: FluRectangle{
@ -43,6 +55,7 @@ FluScrollablePage{
Layout.topMargin: 20 Layout.topMargin: 20
} }
FluToggleSwitch{ FluToggleSwitch{
Layout.topMargin: 5
selected: FluTheme.dark selected: FluTheme.dark
clickFunc:function(){ clickFunc:function(){
FluTheme.dark = !FluTheme.dark FluTheme.dark = !FluTheme.dark
@ -53,9 +66,23 @@ FluScrollablePage{
Layout.topMargin: 20 Layout.topMargin: 20
} }
FluToggleSwitch{ FluToggleSwitch{
Layout.topMargin: 5
selected: FluTheme.nativeText selected: FluTheme.nativeText
clickFunc:function(){ clickFunc:function(){
FluTheme.nativeText = !FluTheme.nativeText FluTheme.nativeText = !FluTheme.nativeText
} }
} }
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluTheme.primaryColor = FluColors.Orange
FluTheme.dark = true
FluTheme.nativeText = true
'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,6 +11,7 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -33,7 +35,12 @@ FluScrollablePage{
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluTimePicker{
}'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -49,7 +56,7 @@ FluScrollablePage{
} }
FluText{ FluText{
text:"hourFormat=FluTimePicker.HH" text:"hourFormat=FluTimePicker.H"
} }
FluTimePicker{ FluTimePicker{
@ -58,6 +65,11 @@ FluScrollablePage{
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluTimePicker{
hourFormat:FluTimePicker.HH
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,12 +11,29 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluToggleSwitch{ FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
Row{
spacing: 30
anchors.verticalCenter: parent.verticalCenter
FluToggleSwitch{
} }
FluToggleSwitch{ FluToggleSwitch{
Layout.topMargin: 20
text:"Text" text:"Text"
} }
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluToggleSwitch{
text:"Text"
}'
}
} }

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
@ -10,13 +11,13 @@ FluScrollablePage{
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
FluText{ FluText{
Layout.topMargin: 20 Layout.topMargin: 20
text:"鼠标悬停不动弹出Tooltip" text:"鼠标悬停不动弹出Tooltip"
} }
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
@ -42,6 +43,18 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluIconButton{
iconSource:FluentIcons.ChromeCloseContrast
iconSize: 15
text:"删除"
onClicked:{
showSuccess("点击IconButton")
}
}
'
}
FluArea{ FluArea{
Layout.fillWidth: true Layout.fillWidth: true
@ -72,6 +85,22 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluButton{
id:button_1
text:"删除"
FluTooltip{
visible: button_1.hovered
text:button_1.text
delay: 1000
}
onClicked:{
showSuccess("点击一个Button")
}
}
'
}
} }

View File

@ -3,13 +3,15 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
import "./component"
FluContentPage { FluScrollablePage {
title:"TreeView" title:"TreeView"
leftPadding:10 leftPadding:10
rightPadding:10 rightPadding:10
bottomPadding:20 bottomPadding:20
spacing: 0
function randomName() { function randomName() {
var names = ["张三", "李四", "王五", "赵六", "钱七", "孙八", "周九", "吴十"] var names = ["张三", "李四", "王五", "赵六", "钱七", "孙八", "周九", "吴十"]
@ -50,71 +52,42 @@ FluContentPage {
return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees)) return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees))
} }
FluArea{
FluTreeView{ id:layout_actions
id:tree_view Layout.fillWidth: true
width:240 Layout.topMargin: 20
anchors{ height: 50
top:parent.top paddings: 10
left:parent.left RowLayout{
bottom:parent.bottom spacing: 14
} FluDropDownButton{
onItemClicked: id:btn_selection_model
(model)=>{ Layout.preferredWidth: 140
showSuccess(model.text) text:"None"
} items:[
FluMenuItem{
Component.onCompleted: {
var org = createOrg(3, 3, 3)
updateData(org)
}
}
ColumnLayout{
anchors{
left: tree_view.right
right: parent.right
top: parent.top
}
FluText{
text:{
if(tree_view.selectionMode === FluTreeView.None){
return "selectionMode->FluTreeView.None"
}
if(tree_view.selectionMode === FluTreeView.Single){
return "selectionMode->FluTreeView.Single"
}
if(tree_view.selectionMode === FluTreeView.Multiple){
return "selectionMode->FluTreeView.Multiple"
}
}
}
FluButton{
text:"None" text:"None"
onClicked: { onClicked: {
tree_view.selectionMode = FluTreeView.None btn_selection_model.text = text
tree_view.selectionMode = FluTabView.Equal
} }
} },
FluMenuItem{
FluButton{
text:"Single" text:"Single"
onClicked: { onClicked: {
tree_view.selectionMode = FluTreeView.Single btn_selection_model.text = text
tree_view.selectionMode = FluTabView.SizeToContent
} }
} },
FluMenuItem{
FluButton{ text:"Muiltple"
text:"Multiple"
onClicked: { onClicked: {
tree_view.selectionMode = FluTreeView.Multiple btn_selection_model.text = text
tree_view.selectionMode = FluTabView.Compact
} }
} }
]
}
FluFilledButton{ FluFilledButton{
text:"获取选中的数据" text:"获取选中的数据"
onClicked: { onClicked: {
@ -139,6 +112,50 @@ FluContentPage {
} }
} }
} }
}
}
FluArea{
Layout.fillWidth: true
Layout.topMargin: 10
paddings: 10
height: 400
FluTreeView{
id:tree_view
width:240
anchors{
top:parent.top
left:parent.left
bottom:parent.bottom
}
onItemClicked:
(model)=>{
showSuccess(model.text)
}
Component.onCompleted: {
var org = createOrg(3, 3, 3)
createItem()
updateData(org)
}
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluTreeView{
id:tree_view
width:240
height:600
Component.onCompleted: {
var datas = []
datas.push(createItem("Node1",false))
datas.push(createItem("Node2",false))
datas.push(createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
updateData(datas)
} }
} }
'
}
}

View File

@ -15,15 +15,19 @@ FluContentPage {
slider.seek(0) slider.seek(0)
} }
ScrollView{ FluArea{
clip: true anchors{
width: parent.width top:parent.top
contentWidth: parent.width left: parent.left
right: parent.right
bottom: parent.bottom
topMargin: 20
}
paddings: 10
ColumnLayout{ ColumnLayout{
spacing: 0 spacing: 0
FluText{ FluText{
text:"Display" text:"Display"
Layout.topMargin: 20
padding: 0 padding: 0
pixelSize: textSize pixelSize: textSize
fontStyle: FluText.Display fontStyle: FluText.Display
@ -65,8 +69,6 @@ FluContentPage {
fontStyle: FluText.Caption fontStyle: FluText.Caption
} }
} }
}
FluSlider{ FluSlider{
id:slider id:slider
@ -82,4 +84,11 @@ FluContentPage {
} }
} }
}
} }

View File

@ -16,8 +16,13 @@ FluExpander{
width:parent.width width:parent.width
readOnly:true readOnly:true
text:code text:code
focus:false
KeyNavigation.priority: KeyNavigation.BeforeItem
background:Rectangle{ 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) radius: 4
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
border.width: 1
} }
} }

View File

@ -3,7 +3,6 @@
import QtQuick import QtQuick
import FluentUI import FluentUI
FluObject{ FluObject{
property var navigationView property var navigationView
@ -19,7 +18,6 @@ FluObject{
FluPaneItemExpander{ FluPaneItemExpander{
title:"Basic input" title:"Basic input"
icon:FluentIcons.CheckboxComposite icon:FluentIcons.CheckboxComposite
FluPaneItem{ FluPaneItem{
title:"Buttons" title:"Buttons"
image:"qrc:/res/image/control/Button.png" image:"qrc:/res/image/control/Button.png"
@ -38,7 +36,6 @@ FluObject{
navigationView.push("qrc:/T_Slider.qml") navigationView.push("qrc:/T_Slider.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"CheckBox" title:"CheckBox"
image:"qrc:/res/image/control/Checkbox.png" image:"qrc:/res/image/control/Checkbox.png"
@ -48,7 +45,6 @@ FluObject{
navigationView.push("qrc:/T_CheckBox.qml") navigationView.push("qrc:/T_CheckBox.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"ToggleSwitch" title:"ToggleSwitch"
onTap:{ onTap:{
@ -92,11 +88,9 @@ FluObject{
} }
} }
FluPaneItemExpander{ FluPaneItemExpander{
title:"Surface" title:"Surface"
icon:FluentIcons.SurfaceHub icon:FluentIcons.SurfaceHub
FluPaneItem{ FluPaneItem{
title:"InfoBar" title:"InfoBar"
image:"qrc:/res/image/control/InfoBar.png" image:"qrc:/res/image/control/InfoBar.png"
@ -106,42 +100,36 @@ FluObject{
navigationView.push("qrc:/T_InfoBar.qml") navigationView.push("qrc:/T_InfoBar.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"Progress" title:"Progress"
onTap:{ onTap:{
navigationView.push("qrc:/T_Progress.qml") navigationView.push("qrc:/T_Progress.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"Badge" title:"Badge"
onTap:{ onTap:{
navigationView.push("qrc:/T_Badge.qml") navigationView.push("qrc:/T_Badge.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"Rectangle" title:"Rectangle"
onTap:{ onTap:{
navigationView.push("qrc:/T_Rectangle.qml") navigationView.push("qrc:/T_Rectangle.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"Carousel" title:"Carousel"
onTap:{ onTap:{
navigationView.push("qrc:/T_Carousel.qml") navigationView.push("qrc:/T_Carousel.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"Expander" title:"Expander"
onTap:{ onTap:{
navigationView.push("qrc:/T_Expander.qml") navigationView.push("qrc:/T_Expander.qml")
} }
} }
} }
FluPaneItemExpander{ FluPaneItemExpander{
@ -153,14 +141,12 @@ FluObject{
navigationView.push("qrc:/T_Dialog.qml") navigationView.push("qrc:/T_Dialog.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"Tooltip" title:"Tooltip"
onTap:{ onTap:{
navigationView.push("qrc:/T_Tooltip.qml") navigationView.push("qrc:/T_Tooltip.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"Menu" title:"Menu"
onTap:{ onTap:{
@ -172,7 +158,6 @@ FluObject{
FluPaneItemExpander{ FluPaneItemExpander{
title:"Navigation" title:"Navigation"
icon:FluentIcons.AllApps icon:FluentIcons.AllApps
FluPaneItem{ FluPaneItem{
title:"Pivot" title:"Pivot"
image:"qrc:/res/image/control/Pivot.png" image:"qrc:/res/image/control/Pivot.png"
@ -226,19 +211,18 @@ FluObject{
navigationView.push("qrc:/T_Theme.qml") navigationView.push("qrc:/T_Theme.qml")
} }
} }
FluPaneItem{
title:"Awesome"
onTap:{
navigationView.push("qrc:/T_Awesome.qml")
}
}
FluPaneItem{ FluPaneItem{
title:"Typography" title:"Typography"
onTap:{ onTap:{
navigationView.push("qrc:/T_Typography.qml") navigationView.push("qrc:/T_Typography.qml")
} }
} }
FluPaneItem{
title:"Awesome"
onTap:{
navigationView.push("qrc:/T_Awesome.qml")
}
}
} }
FluPaneItemExpander{ FluPaneItemExpander{