FluentUI/example/qml/App.qml

56 lines
2.0 KiB
QML
Raw Normal View History

2023-08-24 15:50:37 +08:00
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
2023-04-22 16:02:52 +08:00
2024-03-27 00:36:56 +08:00
FluLauncher {
2023-06-25 19:01:22 +08:00
id: app
2023-09-17 20:36:33 +08:00
Connections{
target: FluTheme
function onDarkModeChanged(){
SettingsHelper.saveDarkMode(FluTheme.darkMode)
}
}
2023-10-15 17:24:33 +08:00
Connections{
target: FluApp
2023-11-23 19:58:54 +08:00
function onUseSystemAppBarChanged(){
SettingsHelper.saveUseSystemAppBar(FluApp.useSystemAppBar)
}
2023-10-15 17:24:33 +08:00
}
2024-03-09 15:35:48 +08:00
Connections{
target: TranslateHelper
function onCurrentChanged(){
SettingsHelper.saveLanguage(TranslateHelper.current)
}
}
2023-04-22 16:02:52 +08:00
Component.onCompleted: {
2023-12-07 23:01:09 +08:00
FluNetwork.openLog = false
2023-11-29 10:41:48 +08:00
FluNetwork.setInterceptor(function(param){
param.addHeader("Token","000000000000000000000")
})
2024-03-13 17:54:11 +08:00
FluApp.init(app,Qt.locale(TranslateHelper.current))
2023-12-13 18:13:35 +08:00
FluApp.windowIcon = "qrc:/example/res/image/favicon.ico"
2023-11-23 19:58:54 +08:00
FluApp.useSystemAppBar = SettingsHelper.getUseSystemAppBar()
2023-09-17 20:36:33 +08:00
FluTheme.darkMode = SettingsHelper.getDarkMode()
2023-07-07 16:04:17 +08:00
FluTheme.enableAnimation = true
2024-03-27 00:36:56 +08:00
FluRouter.routes = {
2023-04-27 09:38:57 +08:00
"/":"qrc:/example/qml/window/MainWindow.qml",
"/about":"qrc:/example/qml/window/AboutWindow.qml",
"/login":"qrc:/example/qml/window/LoginWindow.qml",
2023-07-11 16:43:28 +08:00
"/hotload":"qrc:/example/qml/window/HotloadWindow.qml",
2024-01-04 18:00:44 +08:00
"/crash":"qrc:/example/qml/window/CrashWindow.qml",
2023-04-27 09:38:57 +08:00
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
2023-08-26 17:20:30 +08:00
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml",
"/pageWindow":"qrc:/example/qml/window/PageWindow.qml"
2023-04-22 16:02:52 +08:00
}
2024-01-04 18:00:44 +08:00
var args = Qt.application.arguments
if(args.length>=2 && args[1].startsWith("-crashed=")){
2024-03-27 00:36:56 +08:00
FluRouter.navigate("/crash",{crashFilePath:args[1].replace("-crashed=","")})
2024-01-04 18:00:44 +08:00
}else{
2024-03-27 00:36:56 +08:00
FluRouter.navigate("/")
2024-01-04 18:00:44 +08:00
}
2023-04-22 16:02:52 +08:00
}
}