put menus nearer the menu if they are positioned awkwardly
svn path=/trunk/KDE/kdelibs/; revision=1124355
This commit is contained in:
parent
64238f5f7e
commit
19a9d2f4f6
@ -765,6 +765,15 @@ bool ContainmentPrivate::showContextMenu(const QPointF &point, const QPoint &scr
|
|||||||
if (applet && isPanelContainment()) {
|
if (applet && isPanelContainment()) {
|
||||||
desktopMenu.adjustSize();
|
desktopMenu.adjustSize();
|
||||||
pos = applet->popupPosition(desktopMenu.size());
|
pos = applet->popupPosition(desktopMenu.size());
|
||||||
|
if (formFactor == Vertical) {
|
||||||
|
if (pos.y() + desktopMenu.height() < screenPos.y()) {
|
||||||
|
pos.setY(screenPos.y());
|
||||||
|
}
|
||||||
|
} else if (formFactor == Horizontal) {
|
||||||
|
if (pos.x() + desktopMenu.width() < screenPos.x()) {
|
||||||
|
pos.setX(screenPos.x());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
desktopMenu.exec(pos);
|
desktopMenu.exec(pos);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user