main
朱子楚\zhuzi 2023-04-16 02:28:58 +08:00
parent 6db8c4d4ac
commit 88008e16be
5 changed files with 25 additions and 7 deletions

View File

@ -7,7 +7,7 @@ AppInfo::AppInfo(QObject *parent)
: QObject{parent} : QObject{parent}
{ {
version("1.2.4"); version("1.2.4");
changeLang("En"); lang(new En());
} }
void AppInfo::changeLang(const QString& locale){ void AppInfo::changeLang(const QString& locale){

View File

@ -16,6 +16,7 @@ int main(int argc, char *argv[])
QCoreApplication::setApplicationName("FluentUI"); QCoreApplication::setApplicationName("FluentUI");
QQuickStyle::setStyle("Basic"); QQuickStyle::setStyle("Basic");
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
app.setQuitOnLastWindowClosed(false);
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
qmlRegisterType<ChatController>("Controller",1,0,"ChatController"); qmlRegisterType<ChatController>("Controller",1,0,"ChatController");
AppInfo* appInfo = new AppInfo(); AppInfo* appInfo = new AppInfo();

View File

@ -2,14 +2,16 @@
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import "qrc:///global/" import Qt.labs.platform
import FluentUI import FluentUI
import "qrc:///global/"
FluWindow { FluWindow {
id:rootwindow id:window
width: 1000 width: 1000
height: 640 height: 640
title: "FluentUI" title: "FluentUI"
closeDestory:false
minimumWidth: 520 minimumWidth: 520
minimumHeight: 460 minimumHeight: 460
@ -21,6 +23,18 @@ FluWindow {
darkText: lang.dark_mode darkText: lang.dark_mode
} }
SystemTrayIcon {
visible: true
icon.source: "qrc:/res/image/favicon.ico"
onActivated: {
window.show()
window.raise()
window.requestActivate()
}
}
FluNavigationView{ FluNavigationView{
id:nav_view id:nav_view
anchors.fill: parent anchors.fill: parent

View File

@ -67,7 +67,6 @@ Rectangle{
height: root.height height: root.height
spacing: 0 spacing: 0
RowLayout{ RowLayout{
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.rightMargin: 5 Layout.rightMargin: 5

View File

@ -6,7 +6,6 @@ import FluentUI
ApplicationWindow { ApplicationWindow {
enum LaunchMode { enum LaunchMode {
Standard, Standard,
SingleTask, SingleTask,
@ -14,6 +13,7 @@ ApplicationWindow {
} }
default property alias content: container.data default property alias content: container.data
property bool closeDestory: true
property int launchMode: FluWindow.Standard property int launchMode: FluWindow.Standard
property string route property string route
property var argument:({}) property var argument:({})
@ -50,8 +50,12 @@ ApplicationWindow {
onClosing: onClosing:
(event)=>{ (event)=>{
// if(closeDestory){
helper.destoryWindow() helper.destoryWindow()
}else{
visible = false
event.accepted = false
}
} }
FluInfoBar{ FluInfoBar{