mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
[UI] avoid "jumping around" if window was resized
* resizing in frameless is subject of QSizeGrip in the status bar * also make sure resize grip is always aligned to the right QSizePolicy::MinimumExpanding * the last point still still happens (resize button centered) for an unknown reason
This commit is contained in:
committed by
Mat Sutcliffe
parent
d8ec308a3b
commit
516a7063e5
@@ -213,8 +213,19 @@ namespace BlackGui
|
||||
bool CEnableForFramelessWindow::handleMouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_ASSERT(m_widget);
|
||||
if (m_windowMode == WindowFrameless && event->buttons() & Qt::LeftButton && !m_framelessDragPosition.isNull())
|
||||
if (m_windowMode == WindowFrameless && event->buttons() == Qt::LeftButton && !m_framelessDragPosition.isNull())
|
||||
{
|
||||
const QSize s = m_widget->size();
|
||||
const bool changedSize = (m_moveSize != s);
|
||||
|
||||
// avoid "jumping around" if window was resized
|
||||
// resizing in frameless is subject of QSizeGrip in the status bar
|
||||
if (changedSize)
|
||||
{
|
||||
m_moveSize = s;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_widget->move(event->globalPos() - m_framelessDragPosition);
|
||||
event->accept();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user