summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-12 18:55:03 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-12 19:02:41 (GMT)
commit9f0884773a451a4feef80812e015266bd487dcdc (patch)
tree51d9de90ba4a5cf5cdb5beb9bd979c14399ac238 /src
parentca8928b78185688ef8e31615ddad4a5c9e2972a7 (diff)
downloadQt-9f0884773a451a4feef80812e015266bd487dcdc.zip
Qt-9f0884773a451a4feef80812e015266bd487dcdc.tar.gz
Qt-9f0884773a451a4feef80812e015266bd487dcdc.tar.bz2
Revert Merge Request 551. This introduces regressions to Qt.
The regressions noticed were: Mac OS X: qmenu::menuGeometry line 1024 (new test) QWS and Win32: qmenubar::check_menuPosition line 1508 This reverts commits 6947390 and c1ce854.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qmenu.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index b752ae2..3ea783f 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -1913,9 +1913,10 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
pos.setX(screen.left() + desktopFrame);
}
if (pos.y() + size.height() - 1 > screen.bottom() - desktopFrame) {
- const int bestPos = (snapToMouse ? mouse.y() : p.y()) - desktopFrame - size.height() + 1;
- const int fallbackPos = screen.bottom() - desktopFrame - size.height() + 1;
- pos.setY(qMin(bestPos, fallbackPos));
+ if(snapToMouse)
+ pos.setY(qMin(mouse.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
+ else
+ pos.setY(qMax(p.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
} else if (pos.y() < screen.top() + desktopFrame) {
pos.setY(screen.top() + desktopFrame);
}