diff --git a/example/example_en_US.ts b/example/example_en_US.ts index f39856a6..ebc9833b 100644 --- a/example/example_en_US.ts +++ b/example/example_en_US.ts @@ -535,104 +535,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 - - + + 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 - + -- The current app version - + Now go and download the new version? @@ -641,17 +641,17 @@ Updated content: - + OK - + The current version is already the latest - + The network is abnormal diff --git a/example/example_zh_CN.ts b/example/example_zh_CN.ts index a9c0ee7d..40df5ef0 100644 --- a/example/example_zh_CN.ts +++ b/example/example_zh_CN.ts @@ -535,104 +535,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? @@ -645,17 +645,17 @@ Updated content: - + OK 确定 - + The current version is already the latest 当前版本已经是最新版本 - + The network is abnormal 网络异常 diff --git a/example/qml/window/MainWindow.qml b/example/qml/window/MainWindow.qml index ed85f702..fafed3b8 100644 --- a/example/qml/window/MainWindow.qml +++ b/example/qml/window/MainWindow.qml @@ -21,6 +21,7 @@ FluWindow { launchMode: FluWindowType.SingleTask fitsAppBarWindows: true appBar: FluAppBar { + width: window.width height: 30 showDark: true darkClickListener:(button)=>handleDarkChanged(button) diff --git a/src/FluApp.cpp b/src/FluApp.cpp index 982828ad..2eecabff 100644 --- a/src/FluApp.cpp +++ b/src/FluApp.cpp @@ -76,7 +76,6 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluWindow if(windowRegister){ windowRegister->to(win); } - win->setColor(QColor(Qt::transparent)); } void FluApp::exit(int retCode){ diff --git a/src/FluFramelessHelper.cpp b/src/FluFramelessHelper.cpp index 68521569..e90171d5 100644 --- a/src/FluFramelessHelper.cpp +++ b/src/FluFramelessHelper.cpp @@ -340,7 +340,13 @@ void FluFramelessHelper::componentComplete(){ ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME); }else{ ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME); + for (int i = 0; i < qApp->screens().count(); ++i) { + connect( qApp->screens().at(i),&QScreen::logicalDotsPerInchChanged,this,[=]{ + SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED); + }); + } } + SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); #else window->setFlags((window->flags() & (~Qt::WindowMinMaxButtonsHint) & (~Qt::Dialog)) | Qt::FramelessWindowHint | Qt::Window); window->installEventFilter(this); @@ -351,8 +357,7 @@ void FluFramelessHelper::componentComplete(){ window->setMaximumSize(QSize(w,h)); window->setMinimumSize(QSize(w,h)); } - window->setWidth(w); - window->setHeight(h); + window->resize(QSize(w,h)); _onStayTopChange(); _stayTop.connectNotifySignal(this,SLOT(_onStayTopChange())); _screen.connectNotifySignal(this,SLOT(_onScreenChanged())); diff --git a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml index 40d0dc8e..4aef4bde 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml @@ -16,6 +16,7 @@ Window { property Item appBar: FluAppBar { title: window.title height: 30 + width: window.width showDark: window.showDark showClose: window.showClose showMinimize: window.showMinimize @@ -101,9 +102,6 @@ Window { } lifecycle.onVisible(visible) } - onWidthChanged: { - window.appBar.width = width - } QtObject{ id:d property bool isFirstVisible: true diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml index 8d43c129..63a172e7 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml @@ -15,6 +15,7 @@ Window { property Item appBar: FluAppBar { title: window.title height: 30 + width: window.width showDark: window.showDark showClose: window.showClose showMinimize: window.showMinimize @@ -100,9 +101,6 @@ Window { } lifecycle.onVisible(visible) } - onWidthChanged: { - window.appBar.width = width - } QtObject{ id:d property bool isFirstVisible: true