From 6c8cf8854f957cdf2520c9d199fee80c8d09b901 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 17 Aug 2013 01:13:37 +0200 Subject: span rekonq menu in the right place BUG: 322003 --- src/webwindow/rekonqmenu.cpp | 9 +++++++-- 1 file 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); -- cgit v1.2.1