From ab29743097f6b454078e5c9dbbd807735b441a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Thu, 27 Aug 2020 18:59:25 +0200 Subject: [PATCH] Use correct toolbar style for preferences on macOS 11 Code compiled against macOS 11 SDK must explicitly specify that the window should use preferences-style toolbar, otherwise the tabs would be moved to the right alongside window title, as is done with the standard toolbar now. --- src/osx/cocoa/preferences.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osx/cocoa/preferences.mm b/src/osx/cocoa/preferences.mm index bbc13a1ff9..d7dd66fb99 100644 --- a/src/osx/cocoa/preferences.mm +++ b/src/osx/cocoa/preferences.mm @@ -35,6 +35,7 @@ #include "wx/weakref.h" #include "wx/windowid.h" #include "wx/osx/private.h" +#include "wx/osx/private/available.h" #import @@ -62,6 +63,13 @@ public: m_toolbarRealized(false), m_visiblePage(NULL) { +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 + if ( WX_IS_MACOS_AVAILABLE(11,0) ) + { + NSWindow *win = GetWXWindow(); + [win setToolbarStyle:NSWindowToolbarStylePreference]; + } +#endif m_toolbar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_TEXT); m_toolbar->SetToolBitmapSize(wxSize(32,32));