738 } |
739 } |
739 Q_D(HbView); |
740 Q_D(HbView); |
740 HbView::HbViewFlags originalFlags(d->mViewFlags); |
741 HbView::HbViewFlags originalFlags(d->mViewFlags); |
741 d->mViewFlags = flags; |
742 d->mViewFlags = flags; |
742 if (mainWindow()) { |
743 if (mainWindow()) { |
743 |
744 bool isCurrentView(mainWindow()->currentView() == this); |
744 // Statusbar-animation |
745 if (isCurrentView) { |
745 bool statusBarAnimating = false; |
746 // Statusbar-animation |
746 HbStatusBar *statusBar = HbMainWindowPrivate::d_ptr(mainWindow())->mStatusBar; |
747 bool statusBarAnimating = false; |
747 if ((d->mViewFlags & HbView::ViewStatusBarHidden) && !(originalFlags & HbView::ViewStatusBarHidden)) { |
748 HbStatusBar *statusBar = HbMainWindowPrivate::d_ptr(mainWindow())->mStatusBar; |
|
749 if ((d->mViewFlags & HbView::ViewStatusBarHidden) && !(originalFlags & HbView::ViewStatusBarHidden)) { |
748 #ifdef HB_EFFECTS |
750 #ifdef HB_EFFECTS |
749 HbEffect::start(statusBar, "statusbar", "disappear", this, "statusBarEffectFinished"); |
751 HbEffect::start(statusBar, "statusbar", "disappear", this, "statusBarEffectFinished"); |
750 #endif // HB_EFFECTS |
752 #endif // HB_EFFECTS |
751 statusBarAnimating = true; |
753 statusBarAnimating = true; |
752 } else if (!(d->mViewFlags & HbView::ViewStatusBarHidden) && (originalFlags & HbView::ViewStatusBarHidden)) { |
754 } else if (!(d->mViewFlags & HbView::ViewStatusBarHidden) && (originalFlags & HbView::ViewStatusBarHidden)) { |
753 #ifdef HB_EFFECTS |
755 #ifdef HB_EFFECTS |
754 statusBar->setVisible(true); |
756 statusBar->setVisible(true); |
755 HbEffect::start(statusBar, "statusbar", "appear", this, "statusBarEffectFinished"); |
757 HbEffect::start(statusBar, "statusbar", "appear", this, "statusBarEffectFinished"); |
756 #endif // HB_EFFECTS |
758 #endif // HB_EFFECTS |
757 statusBarAnimating = true; |
759 statusBarAnimating = true; |
758 } |
760 } |
759 |
761 |
760 // Titlebar-animation |
762 // Titlebar-animation |
761 bool titleBarAnimating = false; |
763 bool titleBarAnimating = false; |
762 HbTitleBar *titleBar = HbMainWindowPrivate::d_ptr(mainWindow())->mTitleBar; |
764 HbTitleBar *titleBar = HbMainWindowPrivate::d_ptr(mainWindow())->mTitleBar; |
763 if ((d->mViewFlags & HbView::ViewTitleBarHidden) && !(originalFlags & HbView::ViewTitleBarHidden)) { |
765 if ((d->mViewFlags & HbView::ViewTitleBarHidden) && !(originalFlags & HbView::ViewTitleBarHidden)) { |
764 #ifdef HB_EFFECTS |
766 #ifdef HB_EFFECTS |
765 HbEffect::start(titleBar, "titlebar", "disappear", this, "titleBarEffectFinished"); |
767 HbEffect::start(titleBar, "titlebar", "disappear", this, "titleBarEffectFinished"); |
766 #endif // HB_EFFECTS |
768 #endif // HB_EFFECTS |
767 titleBarAnimating = true; |
769 titleBarAnimating = true; |
768 } else if (!(d->mViewFlags & HbView::ViewTitleBarHidden) && (originalFlags & HbView::ViewTitleBarHidden)) { |
770 } else if (!(d->mViewFlags & HbView::ViewTitleBarHidden) && (originalFlags & HbView::ViewTitleBarHidden)) { |
769 #ifdef HB_EFFECTS |
771 #ifdef HB_EFFECTS |
770 titleBar->setVisible(true); |
772 titleBar->setVisible(true); |
771 HbEffect::start(titleBar, "titlebar", "appear", this, "titleBarEffectFinished"); |
773 HbEffect::start(titleBar, "titlebar", "appear", this, "titleBarEffectFinished"); |
772 #endif // HB_EFFECTS |
774 #endif // HB_EFFECTS |
773 titleBarAnimating = true; |
775 titleBarAnimating = true; |
774 } |
|
775 |
|
776 if (!statusBarAnimating && !titleBarAnimating) { |
|
777 statusBar->setVisible(!(d->mViewFlags & HbView::ViewStatusBarHidden)); |
|
778 statusBar->propertiesChanged(); |
|
779 } |
|
780 if (!titleBarAnimating && !statusBarAnimating) { |
|
781 titleBar->setVisible(!(d->mViewFlags & HbView::ViewTitleBarHidden)); |
|
782 if (d->mNavigationActionSet) { |
|
783 titleBar->setNavigationAction(d->mNavigationAction); |
|
784 } else { |
|
785 titleBar->setDefaultNavigationAction(); |
|
786 } |
776 } |
787 titleBar->propertiesChanged(); |
777 |
|
778 if (!statusBarAnimating && !titleBarAnimating) { |
|
779 statusBar->setVisible(!(d->mViewFlags & HbView::ViewStatusBarHidden)); |
|
780 statusBar->propertiesChanged(); |
|
781 } |
|
782 if (!titleBarAnimating && !statusBarAnimating) { |
|
783 titleBar->setVisible(!(d->mViewFlags & HbView::ViewTitleBarHidden)); |
|
784 if (d->mNavigationActionSet) { |
|
785 titleBar->setNavigationAction(d->mNavigationAction); |
|
786 } else { |
|
787 titleBar->setDefaultNavigationAction(); |
|
788 } |
|
789 titleBar->propertiesChanged(); |
|
790 } |
788 } |
791 } |
789 if (d->toolBar) { |
792 if (d->toolBar) { |
790 d->toolBar->updatePrimitives(); |
793 d->toolBar->updatePrimitives(); |
791 } |
794 } |
792 |
795 |