inputmethod: Only align within availableGeometry if it fits
An input panel in Overlay mode controls it's own size. If there's space we want to fit it centre aligned within the available space, but if it doesn't fit (i.e having a left panel and a full width keyboard) then centre aligning within the available space doesn't make sense. We would half overlap the panel and half go offscreen. This patch adjusts us to centre align to the output in that condition. BUG: 440571
This commit is contained in:
parent
5a3d2593f1
commit
e4f9df54e6
1 changed files with 9 additions and 1 deletions
|
@ -98,7 +98,15 @@ void InputPanelV1Window::resetPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF geo = m_windowGeometry;
|
QRectF geo = m_windowGeometry;
|
||||||
|
|
||||||
|
// if it fits, align within available area
|
||||||
|
if (geo.width() < availableArea.width()) {
|
||||||
geo.moveLeft(availableArea.left() + (availableArea.width() - geo.width()) / 2);
|
geo.moveLeft(availableArea.left() + (availableArea.width() - geo.width()) / 2);
|
||||||
|
} else { // otherwise align to be centred within the screen
|
||||||
|
const QRectF outputArea = activeOutput->geometry();
|
||||||
|
geo.moveLeft(outputArea.left() + (outputArea.width() - geo.width()) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
geo.moveBottom(availableArea.bottom());
|
geo.moveBottom(availableArea.bottom());
|
||||||
|
|
||||||
moveResize(geo);
|
moveResize(geo);
|
||||||
|
|
Loading…
Reference in a new issue