Compare commits
No commits in common. "46f7299362b0645fa700191a8bf2791b0c0bdf13" and "9adb6b645b8f16b6fc0539ebe83d6b8c6fb4373d" have entirely different histories.
46f7299362
...
9adb6b645b
|
@ -113,6 +113,14 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
|||
QGuiApplication::sendEvent(_helper->maximizeButton(),&event);
|
||||
}
|
||||
return false;
|
||||
}else if(uMsg == WM_GETMINMAXINFO){
|
||||
if(IsZoomed(hwnd)){
|
||||
RECT frame = {0,0,0,0};
|
||||
AdjustWindowRectEx(&frame,WS_OVERLAPPEDWINDOW,FALSE,0);
|
||||
_helper->setOffsetXY(QPoint(floor(abs(frame.left)/_helper->window->devicePixelRatio()),floor(abs(frame.bottom)/_helper->window->devicePixelRatio())));
|
||||
}else{
|
||||
_helper->setOffsetXY(QPoint(0,0));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
|
@ -239,6 +247,7 @@ void FluFramelessHelper::componentComplete(){
|
|||
#endif
|
||||
_stayTop = QQmlProperty(window,"stayTop");
|
||||
_screen = QQmlProperty(window,"screen");
|
||||
_offsetXY = QQmlProperty(window,"_offsetXY");
|
||||
_onStayTopChange();
|
||||
_stayTop.connectNotifySignal(this,SLOT(_onStayTopChange()));
|
||||
_screen.connectNotifySignal(this,SLOT(_onScreenChanged()));
|
||||
|
@ -332,6 +341,10 @@ QObject* FluFramelessHelper::maximizeButton(){
|
|||
return var.value<QObject*>();
|
||||
}
|
||||
|
||||
void FluFramelessHelper::setOffsetXY(QPoint val){
|
||||
_offsetXY.write(val);
|
||||
}
|
||||
|
||||
bool FluFramelessHelper::resizeable(){
|
||||
return !(window->width() == window->maximumWidth() && window->width() == window->minimumWidth() && window->height() == window->maximumHeight() && window->height() == window->minimumHeight());
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
bool hoverMaxBtn();
|
||||
bool resizeable();
|
||||
QObject* maximizeButton();
|
||||
void setOffsetXY(QPoint val);
|
||||
Q_INVOKABLE void showSystemMenu();
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
@ -54,6 +55,7 @@ private:
|
|||
FramelessEventFilter* _nativeEvent = nullptr;
|
||||
QQmlProperty _stayTop;
|
||||
QQmlProperty _screen;
|
||||
QQmlProperty _offsetXY;
|
||||
};
|
||||
|
||||
#endif // FLUFRAMELESSHELPER_H
|
||||
|
|
|
@ -73,19 +73,6 @@ Window {
|
|||
Component.onDestruction: {
|
||||
lifecycle.onDestruction()
|
||||
}
|
||||
onVisibilityChanged: {
|
||||
if(visibility === Window.Maximized || visibility === Window.FullScreen){
|
||||
var dx = window.x-Screen.virtualX
|
||||
var dy = window.y-Screen.virtualY
|
||||
if(dx<0 && dy<0){
|
||||
_offsetXY = Qt.point(Math.abs(dx+1),Math.abs(dy+1))
|
||||
}else{
|
||||
_offsetXY = Qt.point(0,0)
|
||||
}
|
||||
}else{
|
||||
_offsetXY = Qt.point(0,0)
|
||||
}
|
||||
}
|
||||
onShowSystemMenu: {
|
||||
if(loader_frameless_helper.item){
|
||||
loader_frameless_helper.item.showSystemMenu()
|
||||
|
|
|
@ -72,19 +72,6 @@ Window {
|
|||
Component.onDestruction: {
|
||||
lifecycle.onDestruction()
|
||||
}
|
||||
onVisibilityChanged: {
|
||||
if(visibility === Window.Maximized || visibility === Window.FullScreen){
|
||||
var dx = window.x-Screen.virtualX
|
||||
var dy = window.y-Screen.virtualY
|
||||
if(dx<0 && dy<0){
|
||||
_offsetXY = Qt.point(Math.abs(dx+1),Math.abs(dy+1))
|
||||
}else{
|
||||
_offsetXY = Qt.point(0,0)
|
||||
}
|
||||
}else{
|
||||
_offsetXY = Qt.point(0,0)
|
||||
}
|
||||
}
|
||||
onShowSystemMenu: {
|
||||
if(loader_frameless_helper.item){
|
||||
loader_frameless_helper.item.showSystemMenu()
|
||||
|
|
Loading…
Reference in New Issue