diff options
author | Serge Krot <Serge.Krot@cib.de> | 2019-09-27 10:18:40 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2019-11-01 00:24:48 +0100 |
commit | d8f6f30936af967625fee9256bf9a3c8dbee7ba8 (patch) | |
tree | b7721ca4434fec8442228203c21bd5626c319253 | |
parent | c538764082f29ef98fb859cae37a895cee2de889 (diff) |
Add ability to set tooltip text for toolbar controls
Change-Id: I994b9cee248900786e0d386bd648bd1d64aeeff7
Reviewed-on: https://gerrit.libreoffice.org/79676
Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de>
Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de>
(cherry picked from commit 092273919e1adec93617b08ebf1d44088301365c)
Reviewed-on: https://gerrit.libreoffice.org/81639
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rwxr-xr-x[-rw-r--r--] | framework/source/uielement/complextoolbarcontroller.cxx | 18 | ||||
-rwxr-xr-x[-rw-r--r--] | framework/source/uielement/generictoolbarcontroller.cxx | 20 |
2 files changed, 37 insertions, 1 deletions
diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index 0ad8f8e01723..51ede7a9a9b4 100644..100755 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -175,7 +175,23 @@ void ComplexToolbarController::statusChanged( const FeatureStateEvent& Event ) } else if ( Event.State >>= aControlCommand ) { - executeControlCommand( aControlCommand ); + if (aControlCommand.Command == "SetQuickHelpText") + { + for (sal_Int32 i = 0; i < aControlCommand.Arguments.getLength(); i++) + { + if (aControlCommand.Arguments[i].Name == "HelpText") + { + OUString aHelpText; + aControlCommand.Arguments[i].Value >>= aHelpText; + m_pToolbar->SetQuickHelpText(m_nID, aHelpText); + break; + } + } + } + else + { + executeControlCommand( aControlCommand ); + } if ( m_bMadeInvisible ) m_pToolbar->ShowItem( m_nID ); } diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index 62cc898f9c8f..a657efd3cc88 100644..100755 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/frame/status/Visibility.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/frame/ControlCommand.hpp> #include <svtools/toolboxcontroller.hxx> #include <vcl/svapp.hxx> @@ -182,6 +183,7 @@ void GenericToolbarController::statusChanged( const FeatureStateEvent& Event ) OUString aStrValue; ItemStatus aItemState; Visibility aItemVisibility; + ControlCommand aControlCommand; if (( Event.State >>= bValue ) && !m_bEnumCommand ) { @@ -239,6 +241,24 @@ void GenericToolbarController::statusChanged( const FeatureStateEvent& Event ) m_pToolbar->ShowItem( m_nID, aItemVisibility.bVisible ); m_bMadeInvisible = !aItemVisibility.bVisible; } + else if ( Event.State >>= aControlCommand ) + { + if (aControlCommand.Command == "SetQuickHelpText") + { + for (sal_Int32 i = 0; i < aControlCommand.Arguments.getLength(); i++) + { + if (aControlCommand.Arguments[i].Name == "HelpText") + { + OUString aHelpText; + aControlCommand.Arguments[i].Value >>= aHelpText; + m_pToolbar->SetQuickHelpText(m_nID, aHelpText); + break; + } + } + } + if ( m_bMadeInvisible ) + m_pToolbar->ShowItem( m_nID ); + } else if ( m_bMadeInvisible ) m_pToolbar->ShowItem( m_nID ); |