diff options
author | Jim Raykowski <raykowj@gmail.com> | 2019-12-05 02:55:57 -0900 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2019-12-20 07:22:04 +0100 |
commit | fdb5ce011cb043475869d0b607ea25b8f32b4314 (patch) | |
tree | 0ef89c747064e30e5dfca215c2a19ff68d174ebc | |
parent | f2f5d74067705b7c64f8fb510952d7cece417627 (diff) |
tdf#108458 Show tooltips in CuiConfigFunctionListBox
Change-Id: I6644e939c644c827e2b3ad019b975a3845585063
Reviewed-on: https://gerrit.libreoffice.org/84555
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
-rw-r--r-- | cui/inc/strings.hrc | 4 | ||||
-rw-r--r-- | cui/source/customize/CommandCategoryListBox.cxx | 1 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 12 | ||||
-rw-r--r-- | cui/source/inc/cfgutil.hxx | 3 | ||||
-rw-r--r-- | cui/uiconfig/ui/menuassignpage.ui | 1 |
5 files changed, 21 insertions, 0 deletions
diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index 1ade0c0d6b38..3169862f2e54 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -396,6 +396,10 @@ #define RID_SVXSTR_EDIT_PATHS NC_("optpathspage|editpaths", "Edit Paths: %1") +#define RID_SVXSTR_COMMANDLABEL NC_("RID_SVXSTR_COMMANDLABEL", "Label") +#define RID_SVXSTR_COMMANDNAME NC_("RID_SVXSTR_COMMANDLABEL", "Command") +#define RID_SVXSTR_COMMANDTIP NC_("RID_SVXSTR_COMMANDLABEL", "Tooltip") + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx index 7576d0771edc..d9e3f57b1352 100644 --- a/cui/source/customize/CommandCategoryListBox.cxx +++ b/cui/source/customize/CommandCategoryListBox.cxx @@ -243,6 +243,7 @@ void CommandCategoryListBox::FillFunctionsList( SfxGroupInfo_Impl* pGrpInfo = m_aGroupInfo.back().get(); pGrpInfo->sCommand = rInfo.Command; pGrpInfo->sLabel = sUIName; + pGrpInfo->sTooltip = sTooltipLabel; pFunctionListBox->append(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), sUIName, xImage); } } diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index b464ff53f4e4..e52ed440d311 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -278,6 +278,7 @@ CuiConfigFunctionListBox::CuiConfigFunctionListBox(std::unique_ptr<weld::TreeVie { m_xTreeView->make_sorted(); m_xTreeView->set_size_request(m_xTreeView->get_approximate_digit_width() * 35, m_xTreeView->get_height_rows(9)); + m_xTreeView->connect_query_tooltip(LINK(this, CuiConfigFunctionListBox, QueryTooltip)); } CuiConfigFunctionListBox::~CuiConfigFunctionListBox() @@ -285,6 +286,17 @@ CuiConfigFunctionListBox::~CuiConfigFunctionListBox() ClearAll(); } +IMPL_LINK(CuiConfigFunctionListBox, QueryTooltip, const weld::TreeIter&, rIter, OUString) +{ + SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(rIter).toInt64()); + if (!pData) + return OUString(); + OUString aLabel = CuiResId(RID_SVXSTR_COMMANDLABEL) + ": "; + OUString aName = CuiResId(RID_SVXSTR_COMMANDNAME) + ": "; + OUString aTip = CuiResId(RID_SVXSTR_COMMANDTIP) + ": "; + return aLabel + pData->sLabel + "\n" + aName + pData->sCommand+ "\n" + aTip + pData->sTooltip; +} + void CuiConfigFunctionListBox::ClearAll() /* Description Deletes all entries in the FunctionListBox, all UserData and all diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index e930c24ac3ec..bfce0d6b13f4 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -92,6 +92,7 @@ struct SfxGroupInfo_Impl OUString sCommand; OUString sLabel; OUString sHelpText; + OUString sTooltip; SfxGroupInfo_Impl( SfxCfgKind n, sal_uInt16 nr, void* pObj = nullptr ) : nKind( n ), nUniqueID( nr ), pObject( pObj ) {} @@ -175,6 +176,8 @@ public: OUString GetHelpText( bool bConsiderParent = true ); OUString GetCurCommand() const; OUString GetCurLabel() const; + + DECL_LINK(QueryTooltip, const weld::TreeIter& rIter, OUString); }; struct SvxConfigGroupBoxResource_Impl; diff --git a/cui/uiconfig/ui/menuassignpage.ui b/cui/uiconfig/ui/menuassignpage.ui index 7f37aad311b0..44d06931ebe4 100644 --- a/cui/uiconfig/ui/menuassignpage.ui +++ b/cui/uiconfig/ui/menuassignpage.ui @@ -322,6 +322,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="has_tooltip">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore1</property> |