1
0
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:
Anton Palgunov 2018-05-10 09:18:39 +02:00 committed by GitHub
commit d048ec851e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,15 +208,15 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
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 {
item.isBordered = bordered
}
if case .background(let color)? = item.additionalParameters[.background], let item = barItem as? CustomButtonTouchBarItem {
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 {
let button = item.button!
button.imageScaling = .scaleProportionallyDown