From b6bc50d16e42392dec0ee5ea861486280c27f9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Thu, 27 Aug 2020 19:09:58 +0200 Subject: [PATCH] Use macOS 11 icons in wxStockPreferencesPage Ase the appropriate SF Symbols for General and Advanced preferences pages on macOS 11, while still using the old templates on older systems. --- src/osx/cocoa/preferences.mm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/osx/cocoa/preferences.mm b/src/osx/cocoa/preferences.mm index d7dd66fb99..415a99fcfa 100644 --- a/src/osx/cocoa/preferences.mm +++ b/src/osx/cocoa/preferences.mm @@ -42,6 +42,19 @@ wxBitmap wxStockPreferencesPage::GetLargeIcon() const { +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 + if ( WX_IS_MACOS_AVAILABLE(11, 0) ) + { + switch ( m_kind ) + { + case Kind_General: + return wxBitmap([NSImage imageWithSystemSymbolName:@"gearshape" accessibilityDescription:nil]); + case Kind_Advanced: + return wxBitmap([NSImage imageWithSystemSymbolName:@"gearshape.2" accessibilityDescription:nil]); + } + } +#endif + switch ( m_kind ) { case Kind_General: @@ -49,6 +62,7 @@ wxBitmap wxStockPreferencesPage::GetLargeIcon() const case Kind_Advanced: return wxBitmap([NSImage imageNamed:NSImageNameAdvanced]); } + return wxBitmap(); // silence compiler warning }