From 82060f816af0e731cc5d088247e47fbab41c3a81 Mon Sep 17 00:00:00 2001 From: Andreas Falkenhahn Date: Fri, 23 Oct 2015 18:57:36 +0200 Subject: [PATCH] Strip mnemonics from the label in wxGTK wxToolBar For consistency with the other platforms, don't show mnemonics in the toolbar label even if they're defined in the label string. --- src/gtk/toolbar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp index c0276904bb..b418965623 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -535,8 +535,11 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) } if (!tool->GetLabel().empty()) { + wxString const + label = wxControl::RemoveMnemonics(tool->GetLabel()); + gtk_tool_button_set_label( - GTK_TOOL_BUTTON(tool->m_item), wxGTK_CONV(tool->GetLabel())); + GTK_TOOL_BUTTON(tool->m_item), wxGTK_CONV(label)); // needed for labels in horizontal toolbar with wxTB_HORZ_LAYOUT gtk_tool_item_set_is_important(tool->m_item, true); }