This commit is contained in:
朱子楚\zhuzi
2024-03-09 15:35:48 +08:00
parent 2a03f24941
commit 7c0c4cc451
167 changed files with 7567 additions and 1816 deletions

View File

@ -8,7 +8,7 @@ import "../component"
FluWindow {
id:window
title:"友情提示"
title: qsTr("Friendly Reminder")
width: 300
height: 400
fixSize: true
@ -37,11 +37,15 @@ FluWindow {
FluText{
id:text_info
anchors{
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: 240
left: parent.left
right: parent.right
leftMargin: 10
rightMargin: 10
}
text:"发生意外错误\n给您带来的不便我们深表歉意"
wrapMode: Text.WordWrap
text: qsTr("We apologize for the inconvenience caused by an unexpected error")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
@ -53,7 +57,7 @@ FluWindow {
bottomMargin: 20
}
FluButton{
text:"日志上报"
text: qsTr("Report Logs")
onClicked: {
FluTools.showFileInFolder(crashFilePath)
}
@ -63,7 +67,7 @@ FluWindow {
height: 1
}
FluFilledButton{
text:"重启程序"
text: qsTr("Restart Program")
onClicked: {
FluApp.exit(931)
}

View File

@ -0,0 +1,115 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
import Qt.labs.platform 1.1
import "../component"
FluWindow {
id:window
title:qsTr("FluentUI Initalizr")
width: 600
height: 400
fixSize: true
// modality: Qt.ApplicationModal
launchMode: FluWindowType.SingleTask
showStayTop: false
Connections{
target: InitalizrHelper
function onError(message){
showError(message)
}
function onSuccess(){
showSuccess("创建成功")
}
}
FluText{
id:text_title
text:qsTr("FluentUI Initalizr")
font: FluTextStyle.Title
anchors{
left: parent.left
top: parent.top
leftMargin: 20
topMargin: 20
}
}
Column{
spacing: 14
anchors{
left: parent.left
top: text_title.bottom
leftMargin: 20
topMargin: 20
}
FluTextBox{
id:text_box_name
width: 180
placeholderText: qsTr("Name")
focus: true
}
Row{
spacing: 8
FluTextBox{
id:text_box_path
width: 300
placeholderText: qsTr("Create In")
anchors.verticalCenter: parent.verticalCenter
Component.onCompleted: {
text = FluTools.toLocalPath(StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0])
}
}
FluButton{
text:qsTr("Browse")
anchors.verticalCenter: parent.verticalCenter
onClicked: {
folder_dialog.open()
}
}
}
}
FolderDialog{
id:folder_dialog
folder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
onAccepted: {
text_box_path.text = FluTools.toLocalPath(currentFolder)
}
}
Rectangle{
id:layout_actions
width: parent.width
height: 60
anchors.bottom: parent.bottom
color: FluTheme.backgroundColor
Row{
height: parent.height
spacing: 20
anchors{
right: parent.right
rightMargin: 20
}
FluButton{
text:qsTr("Cancel")
width: 120
anchors.verticalCenter: parent.verticalCenter
onClicked: {
window.close()
}
}
FluFilledButton{
text:qsTr("Create")
width: 120
anchors.verticalCenter: parent.verticalCenter
onClicked: {
InitalizrHelper.generate(text_box_name.text,text_box_path.text)
}
}
}
}
}

View File

@ -8,7 +8,7 @@ import "../component"
FluWindow {
id:window
title:"热加载"
title: qsTr("Hot Loader")
width: 800
height: 600
minimumWidth: 520
@ -32,7 +32,7 @@ FluWindow {
text:loader.itemLodaer().sourceComponent.errorString()
color:"red"
anchors.fill: parent
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
padding: 20
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter
@ -40,7 +40,7 @@ FluWindow {
}
}
FluText{
text:"拖入qml文件"
text: qsTr("Drag in a qml file")
font.pixelSize: 26
anchors.centerIn: parent
visible: !loader.itemLodaer().item && loader.statusMode === FluStatusLayoutType.Success

View File

@ -6,8 +6,8 @@ import "../component"
FluWindow {
id:window
title:"登录"
id: window
title: qsTr("Login")
width: 400
height: 400
fixSize: true
@ -26,38 +26,34 @@ FluWindow {
}
FluAutoSuggestBox{
id:textbox_uesrname
id: textbox_uesrname
items:[{title:"Admin"},{title:"User"}]
placeholderText: "请输入账号"
placeholderText: qsTr("Please enter the account")
Layout.preferredWidth: 260
Layout.alignment: Qt.AlignHCenter
}
FluTextBox{
id:textbox_password
id: textbox_password
Layout.topMargin: 20
Layout.preferredWidth: 260
placeholderText: "请输入密码"
placeholderText: qsTr("Please enter your password")
echoMode:TextInput.Password
Layout.alignment: Qt.AlignHCenter
}
FluFilledButton{
text:"登录"
text: qsTr("Login")
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 20
onClicked:{
if(textbox_password.text === ""){
showError("请随便输入一个密码")
showError(qsTr("Please feel free to enter a password"))
return
}
onResult({password:textbox_password.text})
window.close()
}
}
}
}

View File

@ -21,7 +21,7 @@ FluWindow {
fitsAppBarWindows: true
appBar: FluAppBar {
height: 30
darkText: Lang.dark_mode
darkText: qsTr("Dark Mode")
showDark: true
darkClickListener:(button)=>handleDarkChanged(button)
closeClickListener: ()=>{dialog_close.open()}
@ -85,7 +85,7 @@ FluWindow {
}
Timer{
id:timer_window_hide_delay
id: timer_window_hide_delay
interval: 150
onTriggered: {
window.hide()
@ -93,29 +93,29 @@ FluWindow {
}
FluContentDialog{
id:dialog_close
title:"退出"
message:"确定要退出程序吗?"
negativeText:"最小化"
id: dialog_close
title: qsTr("Quit")
message: qsTr("Are you sure you want to exit the program?")
negativeText: qsTr("Minimize")
buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.NeutralButton | FluContentDialogType.PositiveButton
onNegativeClicked: {
system_tray.showMessage("友情提示","FluentUI已隐藏至托盘,点击托盘可再次激活窗口");
system_tray.showMessage(qsTr("Friendly Reminder"),qsTr("FluentUI is hidden from the tray, click on the tray to activate the window again"));
timer_window_hide_delay.restart()
}
positiveText:"退出"
neutralText:"取消"
positiveText: qsTr("Quit")
neutralText: qsTr("Cancel")
onPositiveClicked:{
FluApp.exit(0)
}
}
Component{
id:nav_item_right_menu
id: nav_item_right_menu
FluMenu{
id:menu
id: menu
width: 130
FluMenuItem{
text: "在独立窗口打开"
text: qsTr("Open in Separate Window")
visible: true
onClicked: {
FluApp.navigate("/pageWindow",{title:modelData.title,url:modelData.url})
@ -212,7 +212,7 @@ FluWindow {
title:"FluentUI"
onLogoClicked:{
clickCount += 1
showSuccess("点击%1次".arg(clickCount))
showSuccess("%1:%2".arg(qsTr("Click Time")).arg(clickCount))
if(clickCount === 5){
loader.reload()
flipable.flipped = true
@ -222,7 +222,7 @@ FluWindow {
autoSuggestBox:FluAutoSuggestBox{
iconSource: FluentIcons.Search
items: ItemsOriginal.getSearchData()
placeholderText: Lang.search
placeholderText: qsTr("Search")
onItemClicked:
(data)=>{
ItemsOriginal.startPageByItem(data)
@ -312,13 +312,16 @@ FluWindow {
}
FluTour{
id:tour
id: tour
finishText: qsTr("Finish")
nextText: qsTr("Next")
previousText: qsTr("Previous")
steps:{
var data = []
if(!window.useSystemAppBar){
data.push({title:"夜间模式",description: "这里可以切换夜间模式.",target:()=>appBar.buttonDark})
data.push({title:qsTr("Dark Mode"),description: qsTr("Here you can switch to night mode."),target:()=>appBar.buttonDark})
}
data.push({title:"隐藏彩蛋",description: "多点几下试试!!",target:()=>nav_view.imageLogo})
data.push({title:qsTr("Hide Easter eggs"),description: qsTr("Try a few more clicks!!"),target:()=>nav_view.imageLogo})
return data
}
}
@ -328,7 +331,7 @@ FluWindow {
}
FluText{
text:"fps %1".arg(fps_item.fps)
text: "fps %1".arg(fps_item.fps)
opacity: 0.3
anchors{
bottom: parent.bottom
@ -341,12 +344,12 @@ FluWindow {
FluContentDialog{
property string newVerson
property string body
id:dialog_update
title:"升级提示"
message:"FluentUI目前最新版本 "+ newVerson +" -- 当前应用版本 "+AppInfo.version+" \n现在是否去下载新版本\n\n更新内容\n"+body
id: dialog_update
title: qsTr("Upgrade Tips")
message:qsTr("FluentUI is currently up to date ")+ newVerson +qsTr(" -- The current app version") +AppInfo.version+qsTr(" \nNow go and download the new version\n\nUpdated content: \n")+body
buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.PositiveButton
negativeText: "取消"
positiveText:"确定"
negativeText: qsTr("Cancel")
positiveText: qsTr("OK")
onPositiveClicked:{
Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/releases/latest")
}
@ -373,14 +376,14 @@ FluWindow {
dialog_update.open()
}else{
if(!silent){
showInfo("当前版本已经是最新版")
showInfo(qsTr("The current version is already the latest"))
}
}
}
onError:
(status,errorString)=>{
if(!silent){
showError("网络异常!")
showError(qsTr("The network is abnormal"))
}
console.debug(status+";"+errorString)
}

View File

@ -6,8 +6,8 @@ import "../component"
FluWindow {
id:window
title:"SingleInstance"
id: window
title: qsTr("SingleInstance")
width: 500
height: 600
fixSize: true
@ -22,7 +22,7 @@ FluWindow {
}
FluText{
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
anchors{
left: parent.left
right: parent.right
@ -30,6 +30,6 @@ FluWindow {
rightMargin: 20
verticalCenter: parent.verticalCenter
}
text:"我是一个SingleInstance模式的窗口如果我存在我会销毁之前的窗口并创建一个新窗口"
text: qsTr("I'm a SingleInstance window, and if I exist, I'll destroy the previous window and create a new one")
}
}

View File

@ -6,8 +6,8 @@ import "../component"
FluWindow {
id:window
title:"SingleTask"
id: window
title: qsTr("SingleTask")
width: 500
height: 600
fixSize: true
@ -15,7 +15,7 @@ FluWindow {
FluText{
anchors.centerIn: parent
text:"我是一个SingleTask模式的窗口如果我存在我就激活窗口"
text: qsTr("I'm a SingleTask mode window, and if I exist, I activate the window")
}
}

View File

@ -37,7 +37,7 @@ FluWindow {
FluText{
anchors.centerIn: parent
text:"我是一个Standard模式的窗口每次我都会创建一个新的窗口"
text: qsTr("I'm a Standard mode window, and every time I create a new window")
}
}