FluentUI/example/qml/page/T_Settings.qml

110 lines
2.9 KiB
QML
Raw Normal View History

2023-05-22 16:17:51 +08:00
import QtQuick
2023-04-10 18:17:22 +08:00
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import FluentUI
2023-04-27 09:38:57 +08:00
import "qrc:///example/qml/global/"
2023-04-22 16:02:52 +08:00
import "../component"
2023-04-10 18:17:22 +08:00
FluScrollablePage{
title:"Settings"
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
2023-04-19 23:53:00 +08:00
height: 136
2023-04-10 18:17:22 +08:00
paddings: 10
ColumnLayout{
spacing: 10
anchors{
2023-04-14 17:07:54 +08:00
top: parent.top
2023-04-10 18:17:22 +08:00
left: parent.left
}
FluText{
2023-04-19 23:53:00 +08:00
text:lang.dark_mode
2023-05-10 00:27:53 +08:00
font: FluTextStyle.BodyStrong
2023-04-10 18:17:22 +08:00
Layout.bottomMargin: 4
}
Repeater{
2023-04-19 23:53:00 +08:00
model: [{title:"System",mode:FluDarkMode.System},{title:"Light",mode:FluDarkMode.Light},{title:"Dark",mode:FluDarkMode.Dark}]
2023-04-10 18:17:22 +08:00
delegate: FluRadioButton{
2023-05-31 15:39:59 +08:00
checked : FluTheme.darkMode === modelData.mode
2023-04-10 18:17:22 +08:00
text:modelData.title
2023-05-31 15:39:59 +08:00
clickListener:function(){
2023-04-19 23:53:00 +08:00
FluTheme.darkMode = modelData.mode
2023-04-10 18:17:22 +08:00
}
}
}
}
}
2023-04-14 17:07:54 +08:00
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
2023-04-19 23:53:00 +08:00
height: 168
2023-04-14 17:07:54 +08:00
paddings: 10
ColumnLayout{
spacing: 10
anchors{
top: parent.top
left: parent.left
}
FluText{
2023-04-19 23:53:00 +08:00
text:lang.navigation_view_display_mode
2023-05-10 00:27:53 +08:00
font: FluTextStyle.BodyStrong
2023-04-14 17:07:54 +08:00
Layout.bottomMargin: 4
}
2023-04-19 23:53:00 +08:00
Repeater{
model: [{title:"Open",mode:FluNavigationView.Open},{title:"Compact",mode:FluNavigationView.Compact},{title:"Minimal",mode:FluNavigationView.Minimal},{title:"Auto",mode:FluNavigationView.Auto}]
2023-05-31 15:39:59 +08:00
delegate: FluRadioButton{
checked : MainEvent.displayMode===modelData.mode
2023-04-19 23:53:00 +08:00
text:modelData.title
2023-05-31 15:39:59 +08:00
clickListener:function(){
2023-04-19 23:53:00 +08:00
MainEvent.displayMode = modelData.mode
2023-04-14 17:07:54 +08:00
}
}
}
}
}
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
height: 80
paddings: 10
ColumnLayout{
spacing: 10
anchors{
top: parent.top
left: parent.left
}
FluText{
2023-04-19 23:53:00 +08:00
text:lang.locale
2023-05-10 00:27:53 +08:00
font: FluTextStyle.BodyStrong
Layout.bottomMargin: 4
}
Flow{
spacing: 5
2023-04-19 23:53:00 +08:00
Repeater{
model: ["Zh","En"]
2023-05-31 15:39:59 +08:00
delegate: FluRadioButton{
checked: appInfo.lang.objectName === modelData
2023-04-19 23:53:00 +08:00
text:modelData
2023-05-31 15:39:59 +08:00
clickListener:function(){
2023-04-19 23:53:00 +08:00
appInfo.changeLang(modelData)
}
}
}
}
}
}
2023-04-10 18:17:22 +08:00
}