diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-11 18:54:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-11 21:08:46 +0200 |
commit | 976367d5d0d0eb2099df32ca4b562a202da6d405 (patch) | |
tree | 0dae99df5a355e96c3a8d34ad0dbaebd60681e96 /vcl/unx | |
parent | ddca00556cf57e9c4a6c598b74775092e6bb5906 (diff) |
use accessible description before querying help
Change-Id: I1b5814566fd0750b92797cbf8581da0bee003630
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98568
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index d1503f4cae44..ebcb51236fed 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -15176,9 +15176,18 @@ public: gboolean /*keyboard_mode*/, GtkTooltip *tooltip) { const ImplSVHelpData& aHelpData = ImplGetSVHelpData(); - if (aHelpData.mbBalloonHelp) + if (aHelpData.mbBalloonHelp) // extended tips { - /*Current mechanism which needs help installed*/ + // by default use accessible description + AtkObject* pAtkObject = gtk_widget_get_accessible(pWidget); + const char* pDesc = pAtkObject ? atk_object_get_description(pAtkObject) : nullptr; + if (pDesc && pDesc[0]) + { + gtk_tooltip_set_text(tooltip, pDesc); + return true; + } + + // fallback to the mechanism which needs help installed OString sHelpId = ::get_help_id(pWidget); Help* pHelp = !sHelpId.isEmpty() ? Application::GetHelp() : nullptr; if (pHelp) @@ -15190,15 +15199,6 @@ public: return true; } } - - /*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 && pDesc[0]) - { - gtk_tooltip_set_text(tooltip, pDesc); - return true; - } } const char* pDesc = gtk_widget_get_tooltip_text(pWidget); |