summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2023-01-09 22:16:33 -0900
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2023-01-13 08:14:00 +0000
commita1ef8d35d4b664b5d896ff4030a70a4020b26968 (patch)
tree0941f5cba811616c6947d7a2673bea0080e6e78c /sfx2
parentddf4ff31f075e00ca4cbb623b596eabf62ab4758 (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> (cherry picked from commit dc3deffb15f6c924375b38f606eb640fe065089f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145435 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx13
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();
}