Compare commits
3 Commits
993de241cb
...
4dbb68abf6
Author | SHA1 | Date |
---|---|---|
|
4dbb68abf6 | |
|
d37cd00322 | |
|
f04bc2951f |
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue