chore: allow dragging window from titlebar when maximized (#178)
This better matches titlebar behavior of Windows and KDE, and probably a lot more other environments, it also allows for easier unmaximizing because the current titlebar has no dedicated maximize/restore button. Note: This is somewhat problematic on Windows, thus we only apply the change to other platforms for now.
This commit is contained in:
@@ -129,8 +129,14 @@ void TitleBar::mouseMoveEvent(QMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
bool optionalMaximized = false;
|
||||
#if defined(Q_OS_WIN)
|
||||
optionalMaximized = isMaximized();
|
||||
#endif
|
||||
|
||||
if (event->buttons() & Qt::LeftButton && m_dragPending
|
||||
&& !window()->isMaximized() && !window()->isFullScreen()) {
|
||||
&& !window()->isFullScreen() && !optionalMaximized) {
|
||||
|
||||
if (QWindow *wh = window()->windowHandle()) {
|
||||
if (!wh->startSystemMove())
|
||||
window()->move(event->globalPosition().toPoint() - m_moveStartPos);
|
||||
|
||||
Reference in New Issue
Block a user