summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2024-02-24 19:42:36 -0900
committerJim Raykowski <raykowj@gmail.com>2024-02-25 18:28:08 +0100
commita75ad49a45e7b632820de2f046534b7ff2687424 (patch)
treeeabd88622b953b96b21edf48b0bfe962670dc2db
parentfe47872aa8380567af7f453b9d3466cf7acd0d12 (diff)
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 <raykowj@gmail.com>
-rw-r--r--sw/source/uibase/utlui/navipi.cxx16
-rw-r--r--sw/uiconfig/swriter/ui/navigatorpanel.ui4
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 @@
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="row-spacing">6</property>
- <property name="column-spacing">12</property>
<child>
<object class="GtkBox" id="gridcontent16">
<property name="visible">True</property>
@@ -224,12 +223,11 @@
<property name="column-spacing">3</property>
<child>
<object class="GtkToolbar" id="content1">
- <property name="visible">True</property>
<property name="can-focus">True</property>
<property name="toolbar-style">icons</property>
<property name="show-arrow">False</property>
<child>
- <object class="GtkToggleToolButton" id="contenttoggle">
+ <object class="GtkToolButton" id="contenttoggle">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes" context="navigatorpanel|contenttoggle|tooltip_text">Toggle Master View</property>