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