171 // Widget is about to show |
171 // Widget is about to show |
172 void HbIndicatorMenu::showEvent(QShowEvent *event) |
172 void HbIndicatorMenu::showEvent(QShowEvent *event) |
173 { |
173 { |
174 HbMainWindow* mainWnd = mainWindow(); |
174 HbMainWindow* mainWnd = mainWindow(); |
175 Q_ASSERT(mainWnd); |
175 Q_ASSERT(mainWnd); |
176 if (mainWnd && !mShowEventReceived) { |
176 if (mainWnd && !mShowEventReceived) { |
177 connect(mainWnd, SIGNAL(orientationChanged(Qt::Orientation)), |
177 // To have a consistant user experience the indicator menu's behaviour |
178 this, SLOT(orientationChanged(Qt::Orientation))); |
178 // got aligned to the options menu's behaviour. |
179 } |
179 // The menu is now closed before a view/orientation change happens. |
|
180 connect(mainWnd, SIGNAL(aboutToChangeOrientation()), |
|
181 this, SLOT(close())); |
|
182 connect(mainWnd, SIGNAL(aboutToChangeView(HbView *,HbView *)), |
|
183 this, SLOT(close())); |
|
184 } |
|
185 |
|
186 HbIndicatorMenuContent *menuContent = |
|
187 qobject_cast<HbIndicatorMenuContent*>(contentWidget()); |
|
188 menuContent->handleAboutToShow(); |
180 |
189 |
181 HbDialog::showEvent(event); |
190 HbDialog::showEvent(event); |
182 mShowEventReceived = true; |
191 mShowEventReceived = true; |
183 } |
192 } |
184 |
193 |
240 //forward to content widget. |
249 //forward to content widget. |
241 HbIndicatorMenuContent *menuContent = |
250 HbIndicatorMenuContent *menuContent = |
242 qobject_cast<HbIndicatorMenuContent*>(contentWidget()); |
251 qobject_cast<HbIndicatorMenuContent*>(contentWidget()); |
243 menuContent->indicatorRemoved(indicatorRemoved); |
252 menuContent->indicatorRemoved(indicatorRemoved); |
244 } |
253 } |
245 |
|
246 void HbIndicatorMenu::orientationChanged(Qt::Orientation orientation) |
|
247 { |
|
248 Q_UNUSED(orientation); |
|
249 doMenuLayout(); |
|
250 } |
|
251 |
|
252 |
|
253 |
|