forked from github_mirror/framelesshelper
fix system menu wrong position
Signed-off-by: Yuhang Zhao <zhaoyuhang@rankyee.com>
This commit is contained in:
parent
b597d2c91a
commit
b4a27c059b
|
@ -421,10 +421,11 @@ bool QuickStandardTitleBar::mouseEventHandler(QMouseEvent *event)
|
|||
return;
|
||||
}
|
||||
FramelessQuickHelper::get(this)->showSystemMenu([this, button, &scenePos]() -> QPoint {
|
||||
QPoint pos = scenePos;
|
||||
if (button == Qt::LeftButton) {
|
||||
return {0, int(std::round(height()))};
|
||||
pos = {0, int(std::round(height()))};
|
||||
}
|
||||
return scenePos;
|
||||
return mapToGlobal(pos).toPoint();
|
||||
}());
|
||||
});
|
||||
// Don't eat this event, we have not handled it yet.
|
||||
|
|
|
@ -343,11 +343,12 @@ bool StandardTitleBarPrivate::mouseEventHandler(QMouseEvent *event)
|
|||
return;
|
||||
}
|
||||
// Please refer to the comments in StandardTitleBarPrivate::setWindowIconVisible().
|
||||
FramelessWidgetsHelper::get(m_window)->showSystemMenu([button, q, &scenePos]() -> QPoint {
|
||||
FramelessWidgetsHelper::get(m_window)->showSystemMenu([button, q, &scenePos, this]() -> QPoint {
|
||||
QPoint pos = scenePos;
|
||||
if (button == Qt::LeftButton) {
|
||||
return {0, q->height()};
|
||||
pos = {0, q->height()};
|
||||
}
|
||||
return scenePos;
|
||||
return m_window->mapToGlobal(pos);
|
||||
}());
|
||||
});
|
||||
// Don't eat this event, we have not handled it yet.
|
||||
|
|
Loading…
Reference in New Issue