diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 15:14:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 21:29:44 +0100 |
commit | 836705dec8cd68684dfaf01df249e867d7dd5d86 (patch) | |
tree | 327da3a3009bb20cf9998c8ba2587635929ad410 /vcl/unx | |
parent | ad56a550864cbe86687abbea492af47b5ab5d7c6 (diff) |
hook up extended tips to find them in our help
Change-Id: I1360403b3b21eec3fd37bb5ba74e0fab1945af94
Reviewed-on: https://gerrit.libreoffice.org/50590
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 5165ef70fd6e..39d68f110c5a 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2487,6 +2487,7 @@ namespace const ImplSVData* pSVData = ImplGetSVData(); if (pSVData->maHelpData.mbBalloonHelp) { + /*This is how I would prefer things to be, only a few like this though*/ AtkObject* pAtkObject = gtk_widget_get_accessible(pWidget); const char* pDesc = pAtkObject ? atk_object_get_description(pAtkObject) : nullptr; if (pDesc) @@ -2494,6 +2495,19 @@ namespace gtk_tooltip_set_text(tooltip, pDesc); return true; } + + /*So fallback to existing mechanism which needs help installed*/ + OString sHelpId = ::get_help_id(pWidget); + Help* pHelp = !sHelpId.isEmpty() ? Application::GetHelp() : nullptr; + if (pHelp) + { + OUString sHelpText = pHelp->GetHelpText(OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), nullptr); + if (!sHelpText.isEmpty()) + { + gtk_tooltip_set_text(tooltip, OUStringToOString(sHelpText, RTL_TEXTENCODING_UTF8).getStr()); + return true; + } + } } const char* pDesc = gtk_widget_get_tooltip_text(pWidget); @@ -2555,14 +2569,10 @@ namespace set_help_id(pWidget, sHelpId); //hook up for extended help const ImplSVData* pSVData = ImplGetSVData(); - if (pSVData->maHelpData.mbBalloonHelp) + if (pSVData->maHelpData.mbBalloonHelp && !GTK_IS_DIALOG(pWidget)) { - AtkObject* pAtkObject = gtk_widget_get_accessible(pWidget); - if (pAtkObject && atk_object_get_description(pAtkObject)) - { - gtk_widget_set_has_tooltip(pWidget, true); - g_signal_connect(pObject, "query-tooltip", G_CALLBACK(signalTooltipQuery), nullptr); - } + gtk_widget_set_has_tooltip(pWidget, true); + g_signal_connect(pObject, "query-tooltip", G_CALLBACK(signalTooltipQuery), nullptr); } } } |