Set palette label for older macOS versions

This commit is contained in:
Damiano Galassi committed 2024-07-20 08:25:56 +02:00
1 parent 906ffda072
commit 36c76fe5bd
2 files changed
+3

No files matched your search

+1
View File
@@ -38,6 +38,7 @@ final class ButtonToolbarItem : NSToolbarItem {
super.init(itemIdentifier: itemIdentifier)
self.label = label
self.paletteLabel = label
self.toolTip = toolTip
self.setSymbol(symbolName: symbolName, fallbackName: image)
self.action = action
+2
View File
@@ -76,6 +76,7 @@ class DocumentToolbarDelegate: NSObject, NSToolbarDelegate {
if #available(macOS 10.15, *) {
let item = NSMenuToolbarItem(itemIdentifier: itemIdentifier)
item.label = label
item.paletteLabel = label
if #available(macOS 11.0, *) {
item.image = NSImage.init(systemSymbolName: "ellipsis.circle", accessibilityDescription: nil)
} else {
@@ -96,6 +97,7 @@ class DocumentToolbarDelegate: NSObject, NSToolbarDelegate {
let item = ButtonToolbarItem(itemIdentifier: itemIdentifier)
item.label = label
item.paletteLabel = label
item.view = popUpButton
item.minSize = NSSize(width: 48, height: 16)