From 1a0f2afee0b47cbe406e47fc40dfaa0371b93a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Wed, 17 Apr 2024 15:11:14 +0800 Subject: [PATCH] update --- example/example_en_US.ts | 58 +++++++++++++++---------------- example/example_zh_CN.ts | 58 +++++++++++++++---------------- example/qml/page/T_Home.qml | 4 --- example/qml/window/MainWindow.qml | 6 +++- src/FluFrameless.cpp | 8 +++++ src/FluFrameless.h | 1 + 6 files changed, 72 insertions(+), 63 deletions(-) diff --git a/example/example_en_US.ts b/example/example_en_US.ts index 72fff7c3..3301be2d 100644 --- a/example/example_en_US.ts +++ b/example/example_en_US.ts @@ -551,104 +551,104 @@ MainWindow - - + + Quit - + Are you sure you want to exit the program? - + Minimize - + Friendly Reminder - + FluentUI is hidden from the tray, click on the tray to activate the window again - - + + Cancel - + Open in Separate Window - + Click Time - + Search - + Finish - + Next - + Previous - + Dark Mode - + Here you can switch to night mode. - + Hide Easter eggs - + Try a few more clicks!! - + Upgrade Tips - + FluentUI is currently up to date - + -- The current app version - + Now go and download the new version? @@ -657,17 +657,17 @@ Updated content: - + OK - + The current version is already the latest - + The network is abnormal @@ -1343,22 +1343,22 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Home - + FluentUI GitHub - + The latest FluentUI controls and styles for your applications. - + FluentUI Initializr - + FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options. diff --git a/example/example_zh_CN.ts b/example/example_zh_CN.ts index 8ec55285..a1871548 100644 --- a/example/example_zh_CN.ts +++ b/example/example_zh_CN.ts @@ -551,104 +551,104 @@ MainWindow - + Dark Mode 夜间模式 - - + + Quit 退出 - + Are you sure you want to exit the program? 您确定要退出程序吗 - + Minimize 最小化 - + Friendly Reminder 友情提示 - + FluentUI is hidden from the tray, click on the tray to activate the window again FluentUI 在托盘中处于隐藏状态,单击托盘以再次激活窗口 - - + + Cancel 取消 - + Open in Separate Window 在独立窗口中打开 - + Click Time 点击次数 - + Search 搜索 - + Finish 完成 - + Next 下一步 - + Previous 上一步 - + Here you can switch to night mode. 在这里,您可以切换到夜间模式。 - + Hide Easter eggs 隐藏彩蛋 - + Try a few more clicks!! 再试几下!! - + Upgrade Tips 升级提示 - + FluentUI is currently up to date FluentUI 目前最新版本 - + -- The current app version -- 当前应用版本 - + Now go and download the new version? @@ -661,17 +661,17 @@ Updated content: - + OK 确定 - + The current version is already the latest 当前版本已经是最新版本 - + The network is abnormal 网络异常 @@ -1393,22 +1393,22 @@ My only desire is to be permitted to drive out the traitors and restore the Han. T_Home - + FluentUI GitHub FluentUI GitHub - + The latest FluentUI controls and styles for your applications. 最新的 FluentUI 控件和样式 - + FluentUI Initializr FluentUI脚手架 - + FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options. FluentUI 脚手架是一个快速创建项目工具,可帮助您创建和自定义具有各种选项的 Fluent UI 项目 diff --git a/example/qml/page/T_Home.qml b/example/qml/page/T_Home.qml index f291e8e7..596bb55c 100644 --- a/example/qml/page/T_Home.qml +++ b/example/qml/page/T_Home.qml @@ -12,10 +12,6 @@ FluScrollablePage{ animationEnabled: false header: Item{} - FluentInitializrWindow{ - id:fluent_Initializr - } - ListModel{ id: model_header ListElement{ diff --git a/example/qml/window/MainWindow.qml b/example/qml/window/MainWindow.qml index 0e393dc8..4fff0309 100644 --- a/example/qml/window/MainWindow.qml +++ b/example/qml/window/MainWindow.qml @@ -15,7 +15,7 @@ FluWindow { title: "FluentUI" width: 1000 height: 680 - minimumWidth: 520 + minimumWidth: 1000 minimumHeight: 200 launchMode: FluWindowType.SingleTask fitsAppBarWindows: true @@ -28,6 +28,10 @@ FluWindow { z:7 } + FluentInitializrWindow{ + id:fluent_Initializr + } + FluEvent{ name: "checkUpdate" onTriggered: { diff --git a/src/FluFrameless.cpp b/src/FluFrameless.cpp index 95687548..753ce22a 100644 --- a/src/FluFrameless.cpp +++ b/src/FluFrameless.cpp @@ -67,6 +67,8 @@ void FluFrameless::componentComplete() { if (_disabled) { return; } + int w = window()->width(); + int h = window()->height(); _current = window()->winId(); window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) @@ -107,6 +109,12 @@ void FluFrameless::componentComplete() { ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); }); #endif + h = h + _appbar->height(); + if(_fixSize){ + window()->setMaximumSize(QSize(w,h)); + window()->setMinimumSize(QSize(w,h)); + } + window()->resize(QSize(w,h)); connect(this, &FluFrameless::topmostChanged, this, [this] { _setWindowTopmost(topmost()); }); diff --git a/src/FluFrameless.h b/src/FluFrameless.h index 3917d131..6ccf79fb 100644 --- a/src/FluFrameless.h +++ b/src/FluFrameless.h @@ -3,6 +3,7 @@ #include #include #include +#include #include "stdafx.h" #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))