From d455fe875e202ab3ee8cb38fb75a064284535b63 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi
Date: Fri, 6 Oct 2023 21:25:27 +0300
Subject: [PATCH 1/1] macOS: Fixed OS version check
src/macos.m | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/macos.m b/src/macos.m
index 32fbef5b..16552c17 100644
--- a/src/macos.m
+++ b/src/macos.m
@@ -859,12 +859,15 @@ static NSMenuItem *makeMenuItems_(NSMenu *menu, MenuCommands *commands, int atIn
makeMenuItems_(sub, commands, 0, isBookmarksMenu, constData_Array(items),
size_Array(items));
[item setSubmenu:sub];
+#if defined (__MAC_11_0)
if (isBookmarksMenu) {
-#if defined (__MAC_11_0) /* TODO: Is there an equivalent symbol for older macOS? */
[item setImage:[NSImage imageWithSystemSymbolName:@"folder"
accessibilityDescription:nil]];
-#endif
if (@available(macOS 11.0, *)) {
/* TODO: Is there an equivalent symbol for older macOS? */
[item setImage:[NSImage imageWithSystemSymbolName:@"folder"
accessibilityDescription:nil]];
}
}
+#endif
}
else {
[sub release];
@@ -875,12 +878,15 @@ static NSMenuItem *makeMenuItems_(NSMenu *menu, MenuCommands *commands, int atIn
}
else {
item.action = (hasCommand ? @selector(postMenuItemCommand:) : nil);
if (isBookmarksMenu && hasCommand && startsWith_CStr(items[i].command, "!open ")) {
-#if defined (__MAC_11_0) /* TODO: Is there an equivalent symbol for older macOS? */
[item setImage:[NSImage imageWithSystemSymbolName:@"bookmark.fill"
accessibilityDescription:nil]];
-#endif
+#if defined (__MAC_11_0)
if (@available(macOS 11.0, *)) {
if (isBookmarksMenu && hasCommand && startsWith_CStr(items[i].command, "!open ")) {
/* TODO: Is there an equivalent symbol for older macOS? */
[item setImage:[NSImage imageWithSystemSymbolName:@"bookmark.fill"
accessibilityDescription:nil]];
}
}
+#endif
}
[menu insertItem:item atIndex:atIndex++];
deinit_String(&itemTitle);
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).