macos: add xmark to other tab close items

pull/9783/head
Mitchell Hashimoto 2025-12-10 20:56:07 -08:00
parent 1387dbefad
commit eb75d48e6b
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 10 additions and 1 deletions

View File

@ -303,14 +303,23 @@ class TerminalWindow: NSWindow {
.flatMap { $0.target as? NSWindow }
.flatMap { $0.windowController as? TerminalController }
// Close tabs to the right
let item = NSMenuItem(title: "Close Tabs to the Right", action: #selector(TerminalController.closeTabsOnTheRight(_:)), keyEquivalent: "")
item.identifier = Self.closeTabsOnRightMenuItemIdentifier
item.target = targetController
item.setImageIfDesired(systemSymbolName: "xmark")
if !menu.insertItem(item, after: NSSelectorFromString("performCloseOtherTabs:")) &&
!menu.insertItem(item, after: NSSelectorFromString("performClose:")) {
menu.addItem(item)
}
// Other close items should have the xmark to match Safari on macOS 26
for menuItem in menu.items {
if menuItem.action == NSSelectorFromString("performClose:") ||
menuItem.action == NSSelectorFromString("performCloseOtherTabs:") {
menuItem.setImageIfDesired(systemSymbolName: "xmark")
}
}
}
private func isTabContextMenu(_ menu: NSMenu) -> Bool {