summaryrefslogtreecommitdiff
path: root/src/controls/qtmenupopupwindow.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-03-07 14:09:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-11 12:49:41 +0100
commit6f85819fdcdc508410d7a271d648dd558a1a1b51 (patch)
tree683e06b9bcce501b7bed31cc9ba8267a76e67938 /src/controls/qtmenupopupwindow.cpp
parentb19f991a2c1fb9f0ce3ce833b55a0d11d8077032 (diff)
downloadqtquickcontrols-6f85819fdcdc508410d7a271d648dd558a1a1b51.tar.gz
Menu: Make popup menus close from child to parent
Some window managers use fading effects to close popups, resulting on an unnatural animation if menus close from parent to child. Change-Id: I5860b65b2905752f74c8abdad05988980c167323 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/qtmenupopupwindow.cpp')
-rw-r--r--src/controls/qtmenupopupwindow.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/controls/qtmenupopupwindow.cpp b/src/controls/qtmenupopupwindow.cpp
index 74534c2d..64fdd11f 100644
--- a/src/controls/qtmenupopupwindow.cpp
+++ b/src/controls/qtmenupopupwindow.cpp
@@ -86,7 +86,7 @@ void QtMenuPopupWindow::setParentWindow(QQuickWindow *parentWindow)
if (parentWindow) {
connect(parentWindow, SIGNAL(destroyed()), this, SLOT(dismissMenu()));
if (QtMenuPopupWindow *pw = qobject_cast<QtMenuPopupWindow *>(parentWindow))
- connect(this, SIGNAL(menuDismissed()), pw, SLOT(dismissMenu()));
+ connect(pw, SIGNAL(menuDismissed()), this, SLOT(dismissMenu()));
}
}
@@ -106,7 +106,7 @@ void QtMenuPopupWindow::setGeometry(int posx, int posy, int w, int h)
}
if (posy + h > s.height())
- posy = s.height() - h;
+ posy = s.height() - h;
else if (posy < 0)
posy = 0;
@@ -115,9 +115,8 @@ void QtMenuPopupWindow::setGeometry(int posx, int posy, int w, int h)
void QtMenuPopupWindow::dismissMenu()
{
- close();
-
emit menuDismissed();
+ close();
}
void QtMenuPopupWindow::updateSize()