src/hbcore/gui/hbscreen.cpp
changeset 21 4633027730f5
parent 7 923ff622b8b9
equal deleted inserted replaced
7:923ff622b8b9 21:4633027730f5
   150     }
   150     }
   151 
   151 
   152     mScreenPolished = true;
   152     mScreenPolished = true;
   153     HbWidget::polish(params);
   153     HbWidget::polish(params);
   154 
   154 
   155     if (mTb && mDelayedConstructionHandled) {
   155     prepareGeometryChange();
   156         HbToolBarPrivate::d_ptr(mTb)->mDoLayout = true;
   156 
   157     }
       
   158     if (layout()) {
       
   159         layout()->activate();
       
   160     }
       
   161     HbMainWindow *w = mainWindow();
   157     HbMainWindow *w = mainWindow();
   162     HbMainWindowPrivate::d_ptr(w)->postIdleEvent(HbMainWindowPrivate::IdleOrientationEvent);
   158     HbMainWindowPrivate::d_ptr(w)->postIdleEvent(HbMainWindowPrivate::IdleOrientationEvent);
   163 }
   159 }
   164 
   160 
   165 void HbScreen::delayedConstruction()
   161 void HbScreen::delayedConstruction()
   169     }
   165     }
   170     mDelayedConstructionHandled = true;
   166     mDelayedConstructionHandled = true;
   171     if (mTb) {
   167     if (mTb) {
   172         connect(&HbToolBarPrivate::d_ptr(mTb)->core, SIGNAL(orientationChanged()), this, SLOT(toolBarOrientationChanged()));
   168         connect(&HbToolBarPrivate::d_ptr(mTb)->core, SIGNAL(orientationChanged()), this, SLOT(toolBarOrientationChanged()));
   173         connect(&HbToolBarPrivate::d_ptr(mTb)->core, SIGNAL(visibilityChanged()), this, SLOT(decoratorVisibilityChanged()));
   169         connect(&HbToolBarPrivate::d_ptr(mTb)->core, SIGNAL(visibilityChanged()), this, SLOT(decoratorVisibilityChanged()));
   174         HbToolBarPrivate::d_ptr(mTb)->delayedConstruction();
       
   175     }
   170     }
   176     if (mDock) {
   171     if (mDock) {
   177         connect(&HbDockWidgetPrivate::d_ptr(mDock)->core, SIGNAL(visibilityChanged()), this, SLOT(decoratorVisibilityChanged()));
   172         connect(&HbDockWidgetPrivate::d_ptr(mDock)->core, SIGNAL(visibilityChanged()), this, SLOT(decoratorVisibilityChanged()));
   178     }
   173     }
   179 }
   174 }
   246 
   241 
   247 void HbScreen::setToolBarOrientation(Qt::Orientation orientation)
   242 void HbScreen::setToolBarOrientation(Qt::Orientation orientation)
   248 {
   243 {
   249     if (orientation != mToolBarOrientation) {
   244     if (orientation != mToolBarOrientation) {
   250         if (mTb) {
   245         if (mTb) {
   251             HbToolBarPrivate::d_ptr(mTb)->mDoLayout = false;
       
   252             repolish();
   246             repolish();
   253         }
   247         }
   254         mToolBarOrientation = orientation;
   248         mToolBarOrientation = orientation;
   255     }
   249     }
   256 }
   250 }
   261     // Do not repolish if orientation is about to change
   255     // Do not repolish if orientation is about to change
   262     if (window && HbMainWindowPrivate::d_ptr(window)->mOrientationChangeOngoing
   256     if (window && HbMainWindowPrivate::d_ptr(window)->mOrientationChangeOngoing
   263             && mScreenOrientation != HbMainWindowPrivate::d_ptr(window)->mOrientation) {
   257             && mScreenOrientation != HbMainWindowPrivate::d_ptr(window)->mOrientation) {
   264         return;
   258         return;
   265     }
   259     }
   266     if (mTb) {
       
   267         HbToolBarPrivate::d_ptr(mTb)->mDoLayout = false;
       
   268     }
       
   269     repolish();
   260     repolish();
   270     QCoreApplication::sendPostedEvents(this, QEvent::Polish);
       
   271 }
   261 }
   272 
   262 
   273 void HbScreen::currentViewChanged(HbView *view)
   263 void HbScreen::currentViewChanged(HbView *view)
   274 {
   264 {
   275     Q_UNUSED(view);
   265     Q_UNUSED(view);