[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:
Klaus Basan
2019-11-03 04:22:15 +01:00
committed by Mat Sutcliffe
parent d8ec308a3b
commit 516a7063e5
3 changed files with 16 additions and 3 deletions

View File

@@ -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;