From 5a2c0ab29719ac914d30d8789c0e386541702cbf Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 28 Feb 2020 11:13:12 +0000 Subject: weld writer navigator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GtkToggleToolButton are much wider than vcl equivalents. Split the bottom toolbar into two toolbars. Rearrange their contents so the layout of each level visually match. Notes: Master documents have two modes, master content tree and the normal content tree. You can drag entries from the content tree into the document, drag mode drop down controls whether its a link or a copy etc that's dropped in. Documents can be dropped into the content and global trees. If outline tracking isn't active, then when content changes the tree is cleared and refilled, typically an effort is made to reselect the same entry that was previously selected. Additionally, if the amount of content didn't change an effort is made to scroll back to the location the scrollbar was at before the clear. Change-Id: I00c015145eac5b1acc3398d3c40861d830e4264a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89725 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sfx2/source/dialog/recfloat.cxx | 2 +- sfx2/source/sidebar/ControllerFactory.cxx | 6 ++++-- sfx2/source/toolbox/weldutils.cxx | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'sfx2/source') diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 28073a3130b9..18833ea5edfa 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -100,7 +100,7 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(SfxBindings* pBind, SfxChildWindo : SfxModelessDialogController(pBind, pChildWin, pParent, "sfx/ui/floatingrecord.ui", "FloatingRecord") , m_xToolbar(m_xBuilder->weld_toolbar("toolbar")) - , m_xDispatcher(new ToolbarUnoDispatcher(*m_xToolbar, pBind->GetActiveFrame())) + , m_xDispatcher(new ToolbarUnoDispatcher(*m_xToolbar, *m_xBuilder, pBind->GetActiveFrame())) { // start recording SfxBoolItem aItem( SID_RECORDMACRO, true ); diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx index ef07c0827f7b..71d5a3649007 100644 --- a/sfx2/source/sidebar/ControllerFactory.cxx +++ b/sfx2/source/sidebar/ControllerFactory.cxx @@ -139,11 +139,11 @@ Reference ControllerFactory::CreateToolBoxController( } Reference ControllerFactory::CreateToolBoxController( - weld::Toolbar& rToolbar, + weld::Toolbar& rToolbar, weld::Builder& rBuilder, const OUString& rsCommandName, const Reference& rxFrame) { - css::uno::Reference xWidget(new weld::TransportAsXWindow(&rToolbar)); + css::uno::Reference xWidget(new weld::TransportAsXWindow(&rToolbar, &rBuilder)); Reference xController( CreateToolBarController( @@ -188,6 +188,8 @@ Reference ControllerFactory::CreateToolBoxController( if (xController.is()) { + xController->createItemWindow(xWidget); + Reference xUpdatable(xController, UNO_QUERY); if (xUpdatable.is()) xUpdatable->update(); diff --git a/sfx2/source/toolbox/weldutils.cxx b/sfx2/source/toolbox/weldutils.cxx index 1be8559d4d87..c35f9047cf20 100644 --- a/sfx2/source/toolbox/weldutils.cxx +++ b/sfx2/source/toolbox/weldutils.cxx @@ -71,10 +71,11 @@ vcl::ImageType ToolbarUnoDispatcher::GetIconSize() const return eType; } -ToolbarUnoDispatcher::ToolbarUnoDispatcher(weld::Toolbar& rToolbar, +ToolbarUnoDispatcher::ToolbarUnoDispatcher(weld::Toolbar& rToolbar, weld::Builder& rBuilder, const css::uno::Reference& rFrame) : m_xFrame(rFrame) , m_pToolbar(&rToolbar) + , m_pBuilder(&rBuilder) { rToolbar.connect_clicked(LINK(this, ToolbarUnoDispatcher, SelectHdl)); rToolbar.connect_menu_toggled(LINK(this, ToolbarUnoDispatcher, ToggleMenuHdl)); @@ -112,7 +113,8 @@ ToolbarUnoDispatcher::ToolbarUnoDispatcher(weld::Toolbar& rToolbar, void ToolbarUnoDispatcher::CreateController(const OUString& rCommand) { css::uno::Reference xController( - sfx2::sidebar::ControllerFactory::CreateToolBoxController(*m_pToolbar, rCommand, m_xFrame)); + sfx2::sidebar::ControllerFactory::CreateToolBoxController(*m_pToolbar, *m_pBuilder, + rCommand, m_xFrame)); if (xController.is()) maControllers.insert(std::make_pair(rCommand, xController)); @@ -190,6 +192,7 @@ void ToolbarUnoDispatcher::dispose() m_pToolbar->connect_clicked(Link()); m_pToolbar = nullptr; + m_pBuilder = nullptr; } ToolbarUnoDispatcher::~ToolbarUnoDispatcher() { dispose(); } -- cgit