mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-03 12:50:27 +00:00
17 lines
528 B
Swift
17 lines
528 B
Swift
import AppKit
|
|
|
|
extension NSMenuItem {
|
|
/// Sets the image property from a symbol if we want images on our menu items.
|
|
func setImageIfDesired(systemSymbolName symbol: String) {
|
|
// We only set on macOS 26 when icons on menu items became the norm.
|
|
if #available(macOS 26, *) {
|
|
image = NSImage(systemSymbolName: symbol, accessibilityDescription: title)
|
|
}
|
|
#if compiler(>=6.4)
|
|
if #available(macOS 27.0, *) {
|
|
preferredImageVisibility = .automatic
|
|
}
|
|
#endif
|
|
}
|
|
}
|