Set palette label for older macOS versions
This commit is contained in:
2 files changed
+3
No files matched your search
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user