Skip to content

Commit

Permalink
Fix dynamic toolbar tooltip updates on wxGTK
Browse files Browse the repository at this point in the history
wxToolbarTool::SetShortHelp() does not refresh the UI (i.e. the
internal native representation) in all ports.

At some point, wxOSX was affected, but since fixed:
https://trac.wxwidgets.org/ticket/12362

wxGTK appears to intentionally take this route
(https://github.com/wxWidgets/wxWidgets/blob833ae03c6a80dea21b775fa871af0f32289e0bd4/src/gtk/toolbar.cpp#L808)
and addressing it there is impractical because we have to support many
wxGTK versions.

Fixed by using wxToolbar::SetToolShortHelp() instead. Other nearby code
already uses this set of functions, so it seems only appropriate.
  • Loading branch information
vslavik committed May 12, 2020
1 parent ed41303 commit b3a534d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wx/main_toolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class WXMainToolbar : public MainToolbar
if (on)
{
tool->SetLabel(_("Sync"));
tool->SetShortHelp(_("Synchronize the translation with Crowdin"));
m_tb->SetToolShortHelp(m_idUpdate, _("Synchronize the translation with Crowdin"));
#ifdef __WXGTK3__
SetIcon(4 , "poedit-sync-symbolic");
#else
Expand All @@ -97,7 +97,7 @@ class WXMainToolbar : public MainToolbar
else
{
tool->SetLabel(MSW_OR_OTHER(_("Update from code"), _("Update from Code")));
tool->SetShortHelp(_("Update from source code"));
m_tb->SetToolShortHelp(m_idUpdate, _("Update from source code"));
#ifdef __WXGTK3__
SetIcon(4 , "poedit-update-symbolic");
#else
Expand Down

0 comments on commit b3a534d

Please sign in to comment.