diff options
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/sidebar/UnoDeck.cxx | 9 |
3 files changed, 37 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 79b24329a31e..21a6f8bdbfef 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -114,6 +114,22 @@ void ResourceManager::SetIsDeckEnabled(const OUString& rsDeckId, const bool bIsE } } +void ResourceManager::SetDeckTitle(const OUString& rsDeckId, const OUString& sTitle) +{ + DeckContainer::iterator iDeck; + for (iDeck = maDecks.begin(); iDeck != maDecks.end(); ++iDeck) + { + if (iDeck->mbExperimental && !maMiscOptions.IsExperimentalMode()) + continue; + if (iDeck->msId.equals(rsDeckId)) + { + iDeck->msTitle = sTitle; + iDeck->msHelpText = sTitle; + return; + } + } +} + void ResourceManager::SetDeckToDescriptor(const OUString& rsDeckId, VclPtr<Deck> aDeck) { DeckContainer::iterator iDeck; diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index cb03b2d3e9d2..867aa2008aba 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -249,6 +249,8 @@ void SAL_CALL SidebarController::notifyContextChangeEvent (const css::ui::Contex { maAsynchronousDeckSwitch.CancelRequest(); maContextChangeUpdate.RequestCall(); + // TODO: this call is redundant but mandatory for unit test to update context on document loading + UpdateConfigurations(); } } @@ -710,6 +712,16 @@ void SidebarController::SwitchToDeck ( UpdateTitleBarIcons(); } +void SidebarController::notifyDeckTitle(const OUString& targetDeckId) +{ + if (msCurrentDeckId == targetDeckId) + { + maFocusManager.SetDeckTitle(mpCurrentDeck->GetTitleBar()); + mpTabBar->UpdateFocusManager(maFocusManager); + UpdateTitleBarIcons(); + } +} + VclPtr<Panel> SidebarController::CreatePanel ( const OUString& rsPanelId, vcl::Window* pParentWindow, diff --git a/sfx2/source/sidebar/UnoDeck.cxx b/sfx2/source/sidebar/UnoDeck.cxx index f65b21573c94..094fa8a54261 100644 --- a/sfx2/source/sidebar/UnoDeck.cxx +++ b/sfx2/source/sidebar/UnoDeck.cxx @@ -71,6 +71,11 @@ void SAL_CALL SfxUnoDeck::setTitle( const OUString& newTitle ) DeckTitleBar* pTitleBar = pDeck->GetTitleBar(); pTitleBar->SetTitle(newTitle); + + // update the ResourceManager + pSidebarController->GetResourceManager()->SetDeckTitle(mDeckId, newTitle); + pSidebarController->notifyDeckTitle(mDeckId); + } sal_Bool SAL_CALL SfxUnoDeck::isActive() @@ -94,6 +99,9 @@ void SAL_CALL SfxUnoDeck::activate( const sal_Bool bActivate ) pSidebarController->SwitchToDeck(mDeckId); else pSidebarController->SwitchToDefaultDeck(); + + // update the sidebar + pSidebarController->NotifyResize(); } uno::Reference<ui::XPanels> SAL_CALL SfxUnoDeck::getPanels() @@ -123,6 +131,7 @@ void SAL_CALL SfxUnoDeck::setOrderIndex( const sal_Int32 newOrderIndex ) pSidebarController->GetResourceManager()->SetDeckOrderIndex(mDeckId, newOrderIndex); + // update the sidebar pSidebarController->NotifyResize(); } |