sfx2/source/sidebar/SidebarController.cxx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
New commits: commit a1ef8d35d4b664b5d896ff4030a70a4020b26968 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Mon Jan 9 22:16:33 2023 -0900 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Fri Jan 13 08:14:00 2023 +0000 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 <rayk...@gmail.com> (cherry picked from commit dc3deffb15f6c924375b38f606eb640fe065089f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145435 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> 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(); }