diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-03-10 16:20:07 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-04-22 16:12:28 +0200 |
commit | 2845df5b6a3fc598fa59f972b6ce281b36177736 (patch) | |
tree | 24eea8ce9c39aab5c7cb3199ea2ee6940b3d010a /sfx2 | |
parent | a3f56525b391ed73f751a7dc86aae494df3d1f65 (diff) |
Extend ToolBarManager to build weld::Toolbar
- used for SubToolBarController eg. framework shape toolbar popup
present in the sidebar fontwork panel
- add separate implementation for vcl and weld based ToolBarManager
- provide basic functionality for weld based (just inserting standard items with icons
and controllers)
- not implemented: addons items merging etc.
Change-Id: I8e460f34abd512d70e95a1d484d728b7d809ce9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113387
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114411
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/app.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index ed0596250056..b1433520ca97 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -52,6 +52,7 @@ #include <sfx2/dockwin.hxx> #include <shellimpl.hxx> #include <comphelper/lok.hxx> +#include <sidebar/ControllerFactory.hxx> #include <svtools/helpopt.hxx> #include <unotools/viewoptions.hxx> @@ -96,6 +97,16 @@ SfxModule* SfxApplication::GetModule(SfxToolsModule nSharedLib) return g_pSfxApplication->pImpl->aModules[nSharedLib].get(); } +namespace { + css::uno::Reference<css::frame::XToolbarController> SfxWeldToolBoxControllerFactory( const css::uno::Reference< css::frame::XFrame >& rFrame, weld::Toolbar* pToolbar, weld::Builder* pBuilder, const OUString& aCommandURL ) + { + SolarMutexGuard aGuard; + + return sfx2::sidebar::ControllerFactory::CreateToolBoxController( + *pToolbar, *pBuilder, aCommandURL, rFrame, rFrame->getController(), false); + } +} + SfxApplication* SfxApplication::GetOrCreate() { // SFX on demand @@ -113,6 +124,7 @@ SfxApplication* SfxApplication::GetOrCreate() ::framework::SetRefreshToolbars( RefreshToolbars ); ::framework::SetToolBoxControllerCreator( SfxToolBoxControllerFactory ); + ::framework::SetWeldToolBoxControllerCreator( SfxWeldToolBoxControllerFactory ); ::framework::SetStatusBarControllerCreator( SfxStatusBarControllerFactory ); ::framework::SetDockingWindowCreator( SfxDockingWindowFactory ); ::framework::SetIsDockingWindowVisible( IsDockingWindowVisible ); diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 1240100e9daa..99ae9ff3e7e5 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -56,6 +56,7 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/module.hxx> #include <sfx2/app.hxx> +#include <sidebar/ControllerFactory.hxx> #include <unoctitm.hxx> #include <ctrlfactoryimpl.hxx> |