diff options
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); } } } |