ghostty/macos/Sources/Helpers/Extensions/NSMenuItem+Extension.swift
Mitchell Hashimoto 202020cd7d macos: menu item symbols for Tahoe
This is recommended for macOS Tahoe and all standard menu items now have
associated images. This makes our app look more polished and native for
macOS Tahoe.

For icon choice, I tried to copy other native macOS apps as much as
possible, mostly from Xcode. It looks like a lot of apps aren't updated
yet. I'm absolutely open to suggestions for better icons but I think
these are a good starting point.

One menu change is I moved "reset font size" above "increase font size"
which better matches other apps (e.g. Terminal.app).
2025-06-14 19:44:24 -07:00

12 lines
402 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)
}
}
}