summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-08-17 01:13:37 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-08-17 01:13:37 +0200
commit6c8cf8854f957cdf2520c9d199fee80c8d09b901 (patch)
treeea68a94793211c2887203625aaac8234bfbcd56a
parentGet sure WebIcon does NOT autodelete the icon downloader before done (diff)
downloadrekonq-6c8cf8854f957cdf2520c9d199fee80c8d09b901.tar.xz
span rekonq menu in the right place
BUG: 322003
-rw-r--r--src/webwindow/rekonqmenu.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/webwindow/rekonqmenu.cpp b/src/webwindow/rekonqmenu.cpp
index 4ea01708..42a4af40 100644
--- a/src/webwindow/rekonqmenu.cpp
+++ b/src/webwindow/rekonqmenu.cpp
@@ -49,7 +49,6 @@ void RekonqMenu::showEvent(QShowEvent* event)
// rekonq window to reduce the cases that sub-menus might overlap
// the right screen border.
QPoint position = pos();
- int y = position.y();
int w = width();
@@ -58,7 +57,13 @@ void RekonqMenu::showEvent(QShowEvent* event)
int pw = parentWidget->width();
int px = widgetGlobalPos.x();
- QPoint newPosition = QPoint(px + pw - w, y);
+ // if menu does not overlays right border, do NOT move it
+ int xw = position.x() + w;
+ int pxw = px + pw;
+ if (xw < pxw)
+ return;
+
+ QPoint newPosition = QPoint(px + pw - w, position.y());
// Finally, move it there...
move(newPosition);