mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 17:38:38 +00:00
Merge pull request #65 from ReDetection/fix-width
Fix width for borderless buttons
This commit is contained in:
commit
d048ec851e
@ -208,15 +208,15 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
|||||||
barItem = InputSourceBarItem(identifier: identifier, onTap: action, onLongTap: longAction)
|
barItem = InputSourceBarItem(identifier: identifier, onTap: action, onLongTap: longAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
if case .width(let value)? = item.additionalParameters[.width], let widthBarItem = barItem as? CanSetWidth {
|
|
||||||
widthBarItem.setWidth(value: value)
|
|
||||||
}
|
|
||||||
if case .bordered(let bordered)? = item.additionalParameters[.bordered], let item = barItem as? CustomButtonTouchBarItem {
|
if case .bordered(let bordered)? = item.additionalParameters[.bordered], let item = barItem as? CustomButtonTouchBarItem {
|
||||||
item.isBordered = bordered
|
item.isBordered = bordered
|
||||||
}
|
}
|
||||||
if case .background(let color)? = item.additionalParameters[.background], let item = barItem as? CustomButtonTouchBarItem {
|
if case .background(let color)? = item.additionalParameters[.background], let item = barItem as? CustomButtonTouchBarItem {
|
||||||
item.backgroundColor = color
|
item.backgroundColor = color
|
||||||
}
|
}
|
||||||
|
if case .width(let value)? = item.additionalParameters[.width], let widthBarItem = barItem as? CanSetWidth {
|
||||||
|
widthBarItem.setWidth(value: value)
|
||||||
|
}
|
||||||
if case .image(let source)? = item.additionalParameters[.image], let item = barItem as? CustomButtonTouchBarItem {
|
if case .image(let source)? = item.additionalParameters[.image], let item = barItem as? CustomButtonTouchBarItem {
|
||||||
let button = item.button!
|
let button = item.button!
|
||||||
button.imageScaling = .scaleProportionallyDown
|
button.imageScaling = .scaleProportionallyDown
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user