diff --git a/src/FluFramelessHelper.cpp b/src/FluFramelessHelper.cpp index d2bec2c6..ed3be788 100644 --- a/src/FluFramelessHelper.cpp +++ b/src/FluFramelessHelper.cpp @@ -155,18 +155,16 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void * *result = HTCLIENT; return true; }else if(uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN){ - if(FluTools::getInstance()->isWindows11OrGreater() && _helper->hoverMaxBtn() && _helper->resizeable()){ + if(_helper->hoverMaxBtn()){ QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QGuiApplication::sendEvent(_helper->maximizeButton(),&event); return true; } - return false; }else if(uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP){ - if(FluTools::getInstance()->isWindows11OrGreater() && _helper->hoverMaxBtn() && _helper->resizeable()){ + if(_helper->hoverMaxBtn()){ QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QGuiApplication::sendEvent(_helper->maximizeButton(),&event); } - return false; }else if(uMsg == WM_NCPAINT){ *result = FALSE; return true; diff --git a/src/Qt5/imports/FluentUI/Controls/FluAppBar.qml b/src/Qt5/imports/FluentUI/Controls/FluAppBar.qml index 1930e6d7..30b8686d 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluAppBar.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluAppBar.qml @@ -253,7 +253,7 @@ Rectangle{ Layout.preferredHeight: 30 iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize color: { - if(pressed){ + if(down){ return maximizePressColor } if(FluTools.isWindows11OrGreater()){ @@ -291,9 +291,13 @@ Rectangle{ } function _maximizeButtonHover(){ var hover = false - if(btn_maximize.visible){ + if(btn_maximize.visible && FluTools.isWindows11OrGreater() && d.resizable){ if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){ hover = true + }else{ + if(btn_maximize.down){ + btn_maximize.down = false + } } } d.hoverMaxBtn = hover diff --git a/src/Qt6/imports/FluentUI/Controls/FluAppBar.qml b/src/Qt6/imports/FluentUI/Controls/FluAppBar.qml index db0a42af..67436197 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluAppBar.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluAppBar.qml @@ -253,7 +253,7 @@ Rectangle{ Layout.preferredHeight: 30 iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize color: { - if(pressed){ + if(down){ return maximizePressColor } if(FluTools.isWindows11OrGreater()){ @@ -291,9 +291,13 @@ Rectangle{ } function _maximizeButtonHover(){ var hover = false - if(btn_maximize.visible){ + if(btn_maximize.visible && FluTools.isWindows11OrGreater() && d.resizable){ if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){ hover = true + }else{ + if(btn_maximize.down){ + btn_maximize.down = false + } } } d.hoverMaxBtn = hover