mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 08:05:29 +08:00
update
This commit is contained in:
@ -2,6 +2,7 @@ pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
import FluentUI 1.0
|
||||
import "qrc:///example/qml/global"
|
||||
|
||||
FluObject{
|
||||
|
||||
@ -12,7 +13,7 @@ FluObject{
|
||||
FluPaneItemSeparator{}
|
||||
|
||||
FluPaneItem{
|
||||
title:lang.about
|
||||
title:Lang.about
|
||||
icon:FluentIcons.Contact
|
||||
onDropped: { FluApp.navigate("/about") }
|
||||
onTapListener:function(){
|
||||
@ -21,7 +22,7 @@ FluObject{
|
||||
}
|
||||
|
||||
FluPaneItem{
|
||||
title:lang.settings
|
||||
title:Lang.settings
|
||||
icon:FluentIcons.Settings
|
||||
url:"qrc:/example/qml/page/T_Settings.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
|
@ -2,6 +2,7 @@ pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
import FluentUI 1.0
|
||||
import "qrc:///example/qml/global"
|
||||
|
||||
FluObject{
|
||||
|
||||
@ -16,7 +17,7 @@ FluObject{
|
||||
FluPaneItem{
|
||||
id:item_home
|
||||
count: 9
|
||||
title:lang.home
|
||||
title:Lang.home
|
||||
infoBadge:FluBadge{
|
||||
count: item_home.count
|
||||
}
|
||||
@ -47,7 +48,7 @@ FluObject{
|
||||
|
||||
FluPaneItemExpander{
|
||||
id:item_expander_basic_input
|
||||
title:lang.basic_input
|
||||
title:Lang.basic_input
|
||||
icon:FluentIcons.CheckboxComposite
|
||||
editDelegate: FluTextBox{
|
||||
text:item_expander_basic_input.title
|
||||
@ -137,7 +138,7 @@ FluObject{
|
||||
}
|
||||
|
||||
FluPaneItemExpander{
|
||||
title:lang.form
|
||||
title:Lang.form
|
||||
icon:FluentIcons.GridView
|
||||
FluPaneItem{
|
||||
title:"TextBox"
|
||||
@ -172,7 +173,7 @@ FluObject{
|
||||
}
|
||||
|
||||
FluPaneItemExpander{
|
||||
title:lang.surface
|
||||
title:Lang.surface
|
||||
icon:FluentIcons.SurfaceHub
|
||||
FluPaneItem{
|
||||
title:"InfoBar"
|
||||
@ -246,7 +247,7 @@ FluObject{
|
||||
}
|
||||
|
||||
FluPaneItemExpander{
|
||||
title:lang.popus
|
||||
title:Lang.popus
|
||||
icon:FluentIcons.ButtonMenu
|
||||
FluPaneItem{
|
||||
title:"Dialog"
|
||||
@ -284,7 +285,7 @@ FluObject{
|
||||
}
|
||||
|
||||
FluPaneItemExpander{
|
||||
title:lang.navigation
|
||||
title:Lang.navigation
|
||||
icon:FluentIcons.AllApps
|
||||
FluPaneItem{
|
||||
title:"Pivot"
|
||||
@ -353,7 +354,7 @@ FluObject{
|
||||
}
|
||||
|
||||
FluPaneItemExpander{
|
||||
title:lang.theming
|
||||
title:Lang.theming
|
||||
icon:FluentIcons.Brightness
|
||||
FluPaneItem{
|
||||
title:"Acrylic"
|
||||
@ -393,7 +394,7 @@ FluObject{
|
||||
}
|
||||
|
||||
FluPaneItemExpander{
|
||||
title:lang.other
|
||||
title:Lang.other
|
||||
icon:FluentIcons.Shop
|
||||
FluPaneItem{
|
||||
title:"QRCode"
|
||||
|
77
example/qml/global/Lang.qml
Normal file
77
example/qml/global/Lang.qml
Normal file
@ -0,0 +1,77 @@
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
|
||||
QtObject {
|
||||
|
||||
property string home
|
||||
property string basic_input
|
||||
property string form
|
||||
property string surface
|
||||
property string popus
|
||||
property string navigation
|
||||
property string theming
|
||||
property string media
|
||||
property string dark_mode
|
||||
property string sys_dark_mode
|
||||
property string search
|
||||
property string about
|
||||
property string settings
|
||||
property string locale
|
||||
property string navigation_view_display_mode
|
||||
property string other
|
||||
|
||||
function zh(){
|
||||
home="首页"
|
||||
basic_input="基本输入"
|
||||
form="表单"
|
||||
surface="表面"
|
||||
popus="弹窗"
|
||||
navigation="导航"
|
||||
theming="主题"
|
||||
media="媒体"
|
||||
dark_mode="夜间模式"
|
||||
sys_dark_mode="跟随系统"
|
||||
search="查找"
|
||||
about="关于"
|
||||
settings="设置"
|
||||
locale="语言环境"
|
||||
navigation_view_display_mode="导航视图显示模式"
|
||||
other="其他"
|
||||
}
|
||||
|
||||
function en(){
|
||||
home="Home"
|
||||
basic_input="Basic Input"
|
||||
form="Form"
|
||||
surface="Surfaces"
|
||||
popus="Popus"
|
||||
navigation="Navigation"
|
||||
theming="Theming"
|
||||
media="Media"
|
||||
dark_mode="Dark Mode"
|
||||
sys_dark_mode="Sync with system"
|
||||
search="Search"
|
||||
about="About"
|
||||
settings="Settings"
|
||||
locale="Locale"
|
||||
navigation_view_display_mode="NavigationView Display Mode"
|
||||
other="Other"
|
||||
}
|
||||
|
||||
property string __locale
|
||||
property var __localeList: ["Zh","En"]
|
||||
|
||||
on__LocaleChanged: {
|
||||
if(__locale === "Zh"){
|
||||
zh()
|
||||
}else{
|
||||
en()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
__locale = "En"
|
||||
}
|
||||
|
||||
}
|
@ -1,2 +1,3 @@
|
||||
singleton ItemsOriginal 1.0 ItemsOriginal.qml
|
||||
singleton ItemsFooter 1.0 ItemsFooter.qml
|
||||
singleton Lang 1.0 Lang.qml
|
||||
|
@ -104,7 +104,7 @@ FluScrollablePage{
|
||||
left: parent.left
|
||||
}
|
||||
FluText{
|
||||
text:lang.dark_mode
|
||||
text:Lang.dark_mode
|
||||
font: FluTextStyle.BodyStrong
|
||||
Layout.bottomMargin: 4
|
||||
}
|
||||
@ -134,7 +134,7 @@ FluScrollablePage{
|
||||
left: parent.left
|
||||
}
|
||||
FluText{
|
||||
text:lang.navigation_view_display_mode
|
||||
text:Lang.navigation_view_display_mode
|
||||
font: FluTextStyle.BodyStrong
|
||||
Layout.bottomMargin: 4
|
||||
}
|
||||
@ -165,7 +165,7 @@ FluScrollablePage{
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:lang.locale
|
||||
text:Lang.locale
|
||||
font: FluTextStyle.BodyStrong
|
||||
Layout.bottomMargin: 4
|
||||
}
|
||||
@ -173,12 +173,12 @@ FluScrollablePage{
|
||||
Flow{
|
||||
spacing: 5
|
||||
Repeater{
|
||||
model: ["Zh","En"]
|
||||
model: Lang.__localeList
|
||||
delegate: FluRadioButton{
|
||||
checked: AppInfo.lang.objectName === modelData
|
||||
checked: Lang.__locale === modelData
|
||||
text:modelData
|
||||
clickListener:function(){
|
||||
AppInfo.changeLang(modelData)
|
||||
Lang.__locale = modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ FluWindow {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
darkText: lang.dark_mode
|
||||
darkText: Lang.dark_mode
|
||||
showDark: true
|
||||
z:7
|
||||
darkClickListener:(button)=>handleDarkChanged(button)
|
||||
@ -171,7 +171,7 @@ FluWindow {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
darkText: lang.dark_mode
|
||||
darkText: Lang.dark_mode
|
||||
showDark: true
|
||||
darkClickListener:(button)=>handleDarkChanged(button)
|
||||
z:7
|
||||
@ -204,7 +204,7 @@ FluWindow {
|
||||
autoSuggestBox:FluAutoSuggestBox{
|
||||
iconSource: FluentIcons.Search
|
||||
items: ItemsOriginal.getSearchData()
|
||||
placeholderText: lang.search
|
||||
placeholderText: Lang.search
|
||||
onItemClicked:
|
||||
(data)=>{
|
||||
ItemsOriginal.startPageByItem(data)
|
||||
|
Reference in New Issue
Block a user