Use QRect::moveRight() and QRect::moveBottom() in XdgShellClient::transientPlacement()
Summary: It's more intuitive. Test Plan: Relevant tests pass. Reviewers: #kwin Subscribers: davidedmundson, broulik, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D27050
This commit is contained in:
parent
98634e0193
commit
85c099936e
1 changed files with 2 additions and 3 deletions
|
@ -1707,8 +1707,7 @@ QRect XdgShellClient::transientPlacement(const QRect &bounds) const
|
|||
popupPosition.moveLeft(bounds.x());
|
||||
}
|
||||
if (!inBounds(popupPosition, Qt::RightEdge)) {
|
||||
// moveRight suffers from the classic QRect off by one issue
|
||||
popupPosition.moveLeft(bounds.x() + bounds.width() - size.width());
|
||||
popupPosition.moveRight(bounds.right());
|
||||
}
|
||||
}
|
||||
if (constraintAdjustments & PositionerConstraint::ResizeX) {
|
||||
|
@ -1750,7 +1749,7 @@ QRect XdgShellClient::transientPlacement(const QRect &bounds) const
|
|||
popupPosition.moveTop(bounds.y());
|
||||
}
|
||||
if (!inBounds(popupPosition, Qt::BottomEdge)) {
|
||||
popupPosition.moveTop(bounds.y() + bounds.height() - size.height());
|
||||
popupPosition.moveBottom(bounds.bottom());
|
||||
}
|
||||
}
|
||||
if (constraintAdjustments & PositionerConstraint::ResizeY) {
|
||||
|
|
Loading…
Reference in a new issue