From a75ad49a45e7b632820de2f046534b7ff2687424 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Sat, 24 Feb 2024 19:42:36 -0900 Subject: tdf#159875 SwNavigator: improve toggle master view visibility handling This patch sets the visibility of the toolbar container that contains the 'Toggle Master View' toolbutton in the first row of the Navigator's toolbox tools as opposed to the current method of setting the toolbutton item visibility. In this way extra space is not given to the toolbar when it is not visible. Change-Id: I6f2ff97728698b3de4812bb9524b2489beac24ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163898 Tested-by: Jenkins Reviewed-by: Jim Raykowski --- sw/source/uibase/utlui/navipi.cxx | 16 +++------------- sw/uiconfig/swriter/ui/navigatorpanel.ui | 4 +--- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 946f7b67dc91..bb8338e3fe9e 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -295,7 +295,6 @@ IMPL_LINK(SwNavigationPI, ToolBoxSelectHdl, const OUString&, rCommand, void) bool bGlobalMode = IsGlobalMode(); m_pConfig->SetGlobalActive(bGlobalMode); m_xGlobalToolBox->set_item_active("globaltoggle", bGlobalMode); - m_xContent1ToolBox->set_item_active("contenttoggle", bGlobalMode); } else if (rCommand == "save") { @@ -511,11 +510,6 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xDocListBox->set_help_id(HID_NAVIGATOR_LISTBOX); m_xDocListBox->set_size_request(42, -1); // set a nominal width so it takes width of surroundings - if (!IsGlobalDoc()) - { - m_xContent1ToolBox->set_item_visible("contenttoggle", false); - } - bool bFloatingNavigator = ParentIsFloatingWindow(m_xNavigatorDlg); m_xContentTree->ShowTree(); @@ -557,6 +551,8 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, pActView->GetWrtShellPtr()->IsGlblDocSaveLinks()); if (m_pConfig->IsGlobalActive()) ToggleTree(); + else + m_xContent1ToolBox->set_visible(true); if (bFloatingNavigator) m_xGlobalTree->grab_focus(); } @@ -668,13 +664,7 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/, { SwWrtShell* pWrtShell = pActView->GetWrtShellPtr(); m_xContentTree->SetActiveShell(pWrtShell); - bool bGlobal = IsGlobalDoc(); - m_xContent1ToolBox->set_item_visible("contenttoggle", bGlobal); - if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive())) - { - ToggleTree(); - } - if (bGlobal) + if (IsGlobalDoc()) { m_xGlobalToolBox->set_item_active("save", pWrtShell->IsGlblDocSaveLinks()); } diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui index 6b7a198e601a..829b082623ef 100644 --- a/sw/uiconfig/swriter/ui/navigatorpanel.ui +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -209,7 +209,6 @@ False True 6 - 12 True @@ -224,12 +223,11 @@ 3 - True True icons False - + True False Toggle Master View -- cgit