X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/52af3158e974b042008474268570f3bdb7ce95ee..c4e43bea7b24f7b7f58e3f87786490cd81abf0a7:/src/gtk/menu.cpp?ds=sidebyside diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 51fa71566c..002d5f5668 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -747,10 +747,6 @@ wxMenuItem::~wxMenuItem() // return the menu item text without any menu accels /* static */ -// TODO: this is now wrong, because it will be used by public APIs -// to convert from label-with-wxWidgets-hotkeys to plain text, -// and this function converts from GTK+ hotkeys to plain text. - wxString wxMenuItemBase::GetLabelText(const wxString& text) { // The argument to this function will now always be in wxWidgets standard label @@ -800,7 +796,10 @@ wxString wxMenuItemBase::GetLabelText(const wxString& text) wxString wxMenuItem::GetItemLabel() const { - return wxConvertFromGTKToWXLabel(m_text); + wxString label = wxConvertFromGTKToWXLabel(m_text); + if (!m_hotKey.IsEmpty()) + label = label + wxT("\t") + m_hotKey; + return label; } void wxMenuItem::SetItemLabel( const wxString& str ) @@ -1082,7 +1081,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) GtkWidget *menuItem; // cache some data used later - wxString text = mitem->GetItemLabel(); + wxString text = mitem->wxMenuItemBase::GetItemLabel(); int id = mitem->GetId(); bool isstock = wxIsStockID(id); const char *stockid = NULL;