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-06 11:58:20 +0200 |
commit | ac1aefd5174258d9bcb41465ce566ed1a0819f3d (patch) | |
tree | 4032ae853c330f9360e58f7401294e37da517d43 /sfx2 | |
parent | 88cca903a88902e51c24853f1d10aeae39b39cdd (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>
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 227cae7f240b..78358b32fe22 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -49,6 +49,7 @@ #include <sfx2/stbitem.hxx> #include <sfx2/dockwin.hxx> #include <shellimpl.hxx> +#include <sidebar/ControllerFactory.hxx> #include <svtools/helpopt.hxx> #include <unotools/viewoptions.hxx> @@ -93,6 +94,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 @@ -110,6 +121,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 f07aa2d82a86..2212494dc1d4 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -53,6 +53,7 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/module.hxx> #include <sfx2/app.hxx> +#include <sidebar/ControllerFactory.hxx> #include <unoctitm.hxx> #include <ctrlfactoryimpl.hxx> |