Compare commits

...

3 Commits

Author SHA1 Message Date
zhuzichu 4dbb68abf6 update 2024-01-08 17:11:16 +08:00
zhuzichu d37cd00322 update 2024-01-08 17:03:24 +08:00
zhuzichu f04bc2951f update 2024-01-08 16:40:19 +08:00
3 changed files with 20 additions and 18 deletions

View File

@ -30,7 +30,7 @@ static inline bool isCompositionEnabled(){
}
return composition_enabled;
}
return true;
return false;
}
#endif
@ -81,24 +81,25 @@ 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){
_helper->setOriginalPos(QPoint(originalLeft,originalTop));
offsetSize = 0;
}else{
_helper->setOriginalPos({});
offsetSize = 1;
}
if(isMaximum){
_helper->setOriginalPos(QPoint(originalLeft,originalTop));
offsetSize = 0;
}else{
_helper->setOriginalPos({});
offsetSize = 1;
}
if(!isCompositionEnabled()){
offsetSize = 0;
}
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

@ -91,7 +91,7 @@ Window {
var dx = (_originalPos.x - screen.virtualX)/screen.devicePixelRatio
var dy = (_originalPos.y - screen.virtualY)/screen.devicePixelRatio
if(dx<0 && dy<0){
_offsetXY = Qt.point(Math.abs(dx),Math.abs(dy))
_offsetXY = Qt.point(Math.abs(dx)-1,Math.abs(dy)-1)
}else{
_offsetXY = Qt.point(0,0)
}
@ -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

View File

@ -90,7 +90,7 @@ Window {
var dx = (_originalPos.x - screen.virtualX)/screen.devicePixelRatio
var dy = (_originalPos.y - screen.virtualY)/screen.devicePixelRatio
if(dx<0 && dy<0){
_offsetXY = Qt.point(Math.abs(dx),Math.abs(dy))
_offsetXY = Qt.point(Math.abs(dx)-1,Math.abs(dy)-1)
}else{
_offsetXY = Qt.point(0,0)
}