Client: Move bradient buttons inside processMouseTop
To avoid them covering for the edges of the window Change-Id: Id8a1362ec11bd25f54cb2c9fbcbd562af8f283d8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
6dfa35b7a2
commit
0424118abd
@ -351,16 +351,7 @@ bool QWaylandBradientDecoration::handleMouse(QWaylandInputDevice *inputDevice, c
|
|||||||
Q_UNUSED(global);
|
Q_UNUSED(global);
|
||||||
|
|
||||||
// Figure out what area mouse is in
|
// Figure out what area mouse is in
|
||||||
if (closeButtonRect().contains(local)) {
|
if (local.y() <= margins().top()) {
|
||||||
if (clickButton(b, Close))
|
|
||||||
QWindowSystemInterface::handleCloseEvent(window());
|
|
||||||
} else if (maximizeButtonRect().contains(local)) {
|
|
||||||
if (clickButton(b, Maximize))
|
|
||||||
window()->setWindowStates(window()->windowStates() ^ Qt::WindowMaximized);
|
|
||||||
} else if (minimizeButtonRect().contains(local)) {
|
|
||||||
if (clickButton(b, Minimize))
|
|
||||||
window()->setWindowState(Qt::WindowMinimized);
|
|
||||||
} else if (local.y() <= margins().top()) {
|
|
||||||
processMouseTop(inputDevice,local,b,mods);
|
processMouseTop(inputDevice,local,b,mods);
|
||||||
} else if (local.y() > window()->height() + margins().top()) {
|
} else if (local.y() > window()->height() + margins().top()) {
|
||||||
processMouseBottom(inputDevice,local,b,mods);
|
processMouseBottom(inputDevice,local,b,mods);
|
||||||
@ -419,19 +410,31 @@ void QWaylandBradientDecoration::processMouseTop(QWaylandInputDevice *inputDevic
|
|||||||
#endif
|
#endif
|
||||||
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_RIGHT,b);
|
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_RIGHT,b);
|
||||||
} else {
|
} else {
|
||||||
//top reszie bit
|
//top resize bit
|
||||||
#if QT_CONFIG(cursor)
|
#if QT_CONFIG(cursor)
|
||||||
waylandWindow()->setMouseCursor(inputDevice, Qt::SplitVCursor);
|
waylandWindow()->setMouseCursor(inputDevice, Qt::SplitVCursor);
|
||||||
#endif
|
#endif
|
||||||
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP,b);
|
startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP,b);
|
||||||
}
|
}
|
||||||
|
} else if (local.x() <= margins().left()) {
|
||||||
|
processMouseLeft(inputDevice, local, b, mods);
|
||||||
|
} else if (local.x() > window()->width() + margins().left()) {
|
||||||
|
processMouseRight(inputDevice, local, b, mods);
|
||||||
|
} else if (closeButtonRect().contains(local)) {
|
||||||
|
if (clickButton(b, Close))
|
||||||
|
QWindowSystemInterface::handleCloseEvent(window());
|
||||||
|
} else if (maximizeButtonRect().contains(local)) {
|
||||||
|
if (clickButton(b, Maximize))
|
||||||
|
window()->setWindowStates(window()->windowStates() ^ Qt::WindowMaximized);
|
||||||
|
} else if (minimizeButtonRect().contains(local)) {
|
||||||
|
if (clickButton(b, Minimize))
|
||||||
|
window()->setWindowState(Qt::WindowMinimized);
|
||||||
} else {
|
} else {
|
||||||
#if QT_CONFIG(cursor)
|
#if QT_CONFIG(cursor)
|
||||||
waylandWindow()->restoreMouseCursor(inputDevice);
|
waylandWindow()->restoreMouseCursor(inputDevice);
|
||||||
#endif
|
#endif
|
||||||
startMove(inputDevice,b);
|
startMove(inputDevice,b);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandBradientDecoration::processMouseBottom(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b, Qt::KeyboardModifiers mods)
|
void QWaylandBradientDecoration::processMouseBottom(QWaylandInputDevice *inputDevice, const QPointF &local, Qt::MouseButtons b, Qt::KeyboardModifiers mods)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user