From 4f2fcd8865a1f38f2b57fe39d6901855b2535a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Wed, 28 Feb 2024 10:25:22 +0800 Subject: [PATCH] update --- src/FluFramelessHelper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/FluFramelessHelper.cpp b/src/FluFramelessHelper.cpp index 16f3bffb..16a2cfd8 100644 --- a/src/FluFramelessHelper.cpp +++ b/src/FluFramelessHelper.cpp @@ -314,6 +314,9 @@ void FluFramelessHelper::componentComplete(){ _appBar.value()->setProperty("systemMoveEnable",false); } window->setFlags((window->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint); + if(resizeable()){ + window->setFlag(Qt::WindowMaximizeButtonHint); + } _nativeEvent =new FramelessEventFilter(this); qApp->installNativeEventFilter(_nativeEvent); HWND hwnd = reinterpret_cast(window->winId()); @@ -343,9 +346,7 @@ void FluFramelessHelper::componentComplete(){ #endif int w = _realWidth.read().toInt(); int h = _realHeight.read().toInt()+_appBarHeight.read().toInt(); - if(resizeable()){ - window->setFlag(Qt::WindowMaximizeButtonHint); - }else{ + if(!resizeable()){ window->setMaximumSize(QSize(w,h)); window->setMinimumSize(QSize(w,h)); }