Fix missing item labels in wxToolBar overflow menu under macOS
Always set the label, even when not using wxTB_TEXT style, as otherwise
the items shown in the native "overflow" menu use empty strings as
labels and so can't be distinguished at all.
This undoes part of the changes of 1f7cd4807f
(Don't show labels for
toolbars showing icons only in wxOSX, 2016-02-23), but they don't seem
necessary any longer, i.e. calling SetToolShortHelp() doesn't show the
toolbar label when using non-native toolbars, so #16669 remains fixed.
Closes #19226.
This commit is contained in:
@@ -175,14 +175,10 @@ public:
|
||||
|
||||
void UpdateLabel()
|
||||
{
|
||||
// Use an empty string if we're not displaying text
|
||||
wxString labelStr;
|
||||
wxToolBar *tbar = (wxToolBar*) GetToolBar();
|
||||
int style = (tbar ? tbar->GetWindowStyleFlag() : 0);
|
||||
if ( (style & (wxTB_NOICONS | wxTB_TEXT)) != 0 )
|
||||
labelStr = wxStripMenuCodes(m_label);
|
||||
|
||||
wxCFStringRef l(labelStr, GetToolBarFontEncoding());
|
||||
wxCFStringRef l(wxStripMenuCodes(m_label), GetToolBarFontEncoding());
|
||||
wxCFStringRef sh( GetShortHelp(), GetToolBarFontEncoding() );
|
||||
#if wxOSX_USE_NATIVE_TOOLBAR
|
||||
if ( m_toolbarItem )
|
||||
|
Reference in New Issue
Block a user