diff --git a/MTMR/CustomButtonTouchBarItem.swift b/MTMR/CustomButtonTouchBarItem.swift index b89f130..6a14353 100644 --- a/MTMR/CustomButtonTouchBarItem.swift +++ b/MTMR/CustomButtonTouchBarItem.swift @@ -25,6 +25,7 @@ class CustomButtonTouchBarItem: NSCustomTouchBarItem, NSGestureRecognizerDelegat button.cell = CustomButtonCell(backgroundColor: bezelColor!) button.cell?.title = title + button.title = title button.bezelColor = bezelColor self.view = button @@ -105,7 +106,7 @@ class CustomButtonCell: NSButtonCell { extension NSButton { var title: String { get { - return "" + return (self.cell?.title)! } set (newTitle) { diff --git a/MTMR/Widgets/CurrencyBarItem.swift b/MTMR/Widgets/CurrencyBarItem.swift index f648db3..2a4b512 100644 --- a/MTMR/Widgets/CurrencyBarItem.swift +++ b/MTMR/Widgets/CurrencyBarItem.swift @@ -109,7 +109,7 @@ class CurrencyBarItem: CustomButtonTouchBarItem { let title = String(format: "%@%.2f", self.prefix, value) - let newTitle = NSMutableAttributedString(string: title as String, attributes: [NSAttributedStringKey.foregroundColor: color, NSAttributedStringKey.font: NSFont.systemFont(ofSize: 15, weight: .regular)]) + let newTitle = NSMutableAttributedString(string: title as String, attributes: [NSAttributedStringKey.foregroundColor: color, NSAttributedStringKey.font: button.attributedTitle.attribute(NSAttributedStringKey.font, at: 0, effectiveRange: nil)]) newTitle.setAlignment(.center, range: NSRange(location: 0, length: title.count)) button.attributedTitle = newTitle }