mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-10 17:08:39 +00:00
* font style
This commit is contained in:
parent
cc1332dd02
commit
5f02bb2962
@ -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) {
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user