From aba18412cd2c4676f0075e5dede4a72e8de3e854 Mon Sep 17 00:00:00 2001 From: Ryan McGrath Date: Mon, 28 Jun 2021 13:11:41 -0700 Subject: [PATCH] Resolves #11. Pass the actual value, which should compile on macOS 10.15.7 and lower. --- src/macos/toolbar/enums.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/macos/toolbar/enums.rs b/src/macos/toolbar/enums.rs index 8ab0c1e..7a5bdd2 100644 --- a/src/macos/toolbar/enums.rs +++ b/src/macos/toolbar/enums.rs @@ -87,7 +87,6 @@ extern "C" { static NSToolbarShowColorsItemIdentifier: id; static NSToolbarShowFontsItemIdentifier: id; static NSToolbarSpaceItemIdentifier: id; - static NSToolbarSidebarTrackingSeparatorItemIdentifier: id; } impl ItemIdentifier { @@ -103,7 +102,10 @@ impl ItemIdentifier { Self::Fonts => NSToolbarShowFontsItemIdentifier, Self::Space => NSToolbarSpaceItemIdentifier, Self::ToggleSidebar => NSToolbarToggleSidebarItemIdentifier, - Self::SidebarTracker => NSToolbarSidebarTrackingSeparatorItemIdentifier + + // This ensures that the framework compiles and runs on 10.15.7 and lower; it will + // not actually work on anything except 11.0+. Use a runtime check to be safe. + Self::SidebarTracker => NSString::no_copy("NSToolbarSidebarTrackingSeparatorItemIdentifier").into() } } }