From ce48d01e8a5ab525018f5bcbee6ab33f64f1786c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 6 Aug 2021 21:17:51 +0200 Subject: [PATCH] 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. --- src/osx/cocoa/toolbar.mm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index a1e11e68f1..2e3e823340 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -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 )