src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu.cpp
changeset 5 627c4a0fd0e7
parent 2 06ff229162e9
child 6 c3690ec91ef8
--- a/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu.cpp	Thu May 27 13:10:59 2010 +0300
+++ b/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu.cpp	Fri Jun 11 13:58:22 2010 +0300
@@ -173,11 +173,20 @@
 {
     HbMainWindow* mainWnd = mainWindow();
     Q_ASSERT(mainWnd);
-    if (mainWnd && !mShowEventReceived) {
-        connect(mainWnd, SIGNAL(orientationChanged(Qt::Orientation)),
-                this, SLOT(orientationChanged(Qt::Orientation)));
+    if (mainWnd && !mShowEventReceived) {        
+        // To have a consistant user experience the indicator menu's behaviour
+        // got aligned to the options menu's behaviour.
+        // The menu is now closed before a view/orientation change happens.
+        connect(mainWnd, SIGNAL(aboutToChangeOrientation()),
+                this, SLOT(close()));
+        connect(mainWnd, SIGNAL(aboutToChangeView(HbView *,HbView *)),
+                this, SLOT(close()));
     }
 
+    HbIndicatorMenuContent *menuContent =
+        qobject_cast<HbIndicatorMenuContent*>(contentWidget());
+    menuContent->handleAboutToShow();
+
     HbDialog::showEvent(event);
     mShowEventReceived = true;
 }
@@ -242,12 +251,3 @@
             qobject_cast<HbIndicatorMenuContent*>(contentWidget());
     menuContent->indicatorRemoved(indicatorRemoved);
 }
-
-void HbIndicatorMenu::orientationChanged(Qt::Orientation orientation)
-{
-    Q_UNUSED(orientation);
-    doMenuLayout();
-}
-
-
-