1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-25 19:21:41 +03:00

calculate properly popup dialogs positioning

This commit is contained in:
Michail Vourlakos 2021-05-03 04:14:56 +03:00
parent e7e593c42b
commit 397cacf112

View File

@ -119,13 +119,13 @@ void Dialog::adjustGeometry(const QRect &geom)
int popupmargin = qMax(0, appletsPopUpMargin());
if (m_edge == Plasma::Types::LeftEdge) {
x = parenttopleft.x() + visualparent->width() - 1 + popupmargin;
x = parenttopleft.x() + visualparent->width() + popupmargin;
} else if (m_edge == Plasma::Types::RightEdge) {
x = parenttopleft.x() - geom.width() + 1 - popupmargin;
x = parenttopleft.x() - geom.width() - popupmargin;
} else if (m_edge == Plasma::Types::TopEdge) {
y = parenttopleft.y() + visualparent->height() - 1 + popupmargin;
y = parenttopleft.y() + visualparent->height() + popupmargin;
} else { // bottom case
y = parenttopleft.y() - geom.height() + 1 - popupmargin;
y = parenttopleft.y() - geom.height() - popupmargin;
}
x = qBound(screengeometry.x(), x, screengeometry.right()-1);