This commit is contained in:
zhuzichu 2024-01-08 16:40:19 +08:00
parent 993de241cb
commit f04bc2951f
2 changed files with 11 additions and 8 deletions

View File

@ -81,10 +81,10 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
return true;
}
int offsetSize = 0;
bool isMax = IsZoomed(hwnd);
bool isMaximum = IsZoomed(hwnd);
offsetXY = QPoint(abs(clientRect->left - originalLeft),abs(clientRect->top - originalTop));
if(isCompositionEnabled()){
if(isMax){
if(isMaximum){
_helper->setOriginalPos(QPoint(originalLeft,originalTop));
offsetSize = 0;
}else{
@ -96,9 +96,11 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
}
clientRect->top = originalTop+offsetSize;
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
clientRect->bottom = originalBottom-offsetSize;
clientRect->left = originalLeft+offsetSize;
clientRect->right = originalRight-offsetSize;
if(!isMaximum){
clientRect->bottom = originalBottom-offsetSize;
clientRect->left = originalLeft+offsetSize;
clientRect->right = originalRight-offsetSize;
}
#endif
*result = WVR_REDRAW;
return true;

View File

@ -206,12 +206,13 @@ Window {
}
Item{
id:layout_container
property bool isMaximum : window.visibility == Window.Maximized
anchors{
fill:parent
topMargin: _offsetXY.y
bottomMargin: _offsetXY.y
leftMargin: _offsetXY.x
rightMargin: _offsetXY.x
bottomMargin: isMaximum ? 0 : _offsetXY.y
leftMargin: isMaximum ? 0 :_offsetXY.x
rightMargin: isMaximum ? 0 : _offsetXY.x
}
onWidthChanged: {
window.appBar.width = width