diff options
author | Jim Raykowski <raykowj@gmail.com> | 2023-01-09 22:16:33 -0900 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2023-01-12 20:02:05 +0000 |
commit | dc3deffb15f6c924375b38f606eb640fe065089f (patch) | |
tree | d5648b162bee8c22c01315b2e8939b5849d72cb4 /sfx2 | |
parent | 933519505aee0e91ca99af0ed860e4a0f148f922 (diff) |
tdf#152921 Fix sidebar tabbar tab highlighting
Makes the highlight state of the tabbar tab behave as expected when
the sidebar is in the collapsed or expanded state. When collapsed, the
tabbar should never have a highlighted tab. When expanded, the tab in
the tabbar corrosponding to the open deck should be highlighted.
Change-Id: I0e6c54aff95b1f1e417f147070742e900fd51513
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145251
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index a35bb1f7488c..3546297df79c 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -476,6 +476,7 @@ void SidebarController::NotifyResize() mpCurrentDeck->setPosSizePixel(nDeckX, 0, nWidth - nTabBarDefaultWidth, nHeight); mpCurrentDeck->Show(); mpCurrentDeck->RequestLayout(); + mpTabBar->HighlightDeck(mpCurrentDeck->GetId()); } else mpCurrentDeck->Hide(); @@ -599,10 +600,6 @@ void SidebarController::UpdateConfigurations() return; } - // Tell the tab bar to highlight the button associated - // with the deck. - mpTabBar->HighlightDeck(sNewDeckId); - std::shared_ptr<DeckDescriptor> xDescriptor = mpResourceManager->GetDeckDescriptor(sNewDeckId); if (xDescriptor) @@ -830,8 +827,6 @@ void SidebarController::SwitchToDeck ( msCurrentDeckId = rDeckDescriptor.msId; } - mpTabBar->HighlightDeck(msCurrentDeckId); - // Determine the panels to display in the deck. ResourceManager::PanelContextDescriptorContainer aPanelContextDescriptors; @@ -1255,8 +1250,7 @@ void SidebarController::RequestCloseDeck() mbIsDeckRequestedOpen = false; UpdateDeckOpenState(); - if (!mpCurrentDeck) - mpTabBar->RemoveDeckHighlight(); + mpTabBar->RemoveDeckHighlight(); } void SidebarController::RequestOpenDeck() @@ -1376,9 +1370,6 @@ void SidebarController::UpdateDeckOpenState() mpParentWindow->SetStyle(mpParentWindow->GetStyle() & ~WB_SIZEABLE); } - mbIsDeckOpen = *mbIsDeckRequestedOpen; - if (*mbIsDeckOpen && mpCurrentDeck) - mpCurrentDeck->Show(); NotifyResize(); } |