mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 09:28:38 +00:00
Changed touchbarcontroller to load image in group item
This commit is contained in:
parent
5f876acc72
commit
13cfab2e82
@ -230,7 +230,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
||||
guard let item = self.items[identifier],
|
||||
let definition = self.itemDefinitions[identifier],
|
||||
definition.align != .center else {
|
||||
return nil
|
||||
return nil
|
||||
}
|
||||
return item
|
||||
}
|
||||
@ -309,8 +309,12 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
||||
if case let .width(value)? = item.additionalParameters[.width], let widthBarItem = barItem as? CanSetWidth {
|
||||
widthBarItem.setWidth(value: value)
|
||||
}
|
||||
if case let .image(source)? = item.additionalParameters[.image], let item = barItem as? CustomButtonTouchBarItem {
|
||||
item.image = source.image
|
||||
if case let .image(source)? = item.additionalParameters[.image] {
|
||||
if let item = barItem as? GroupBarItem {
|
||||
item.collapsedRepresentationImage = source.image
|
||||
} else if let item = barItem as? CustomButtonTouchBarItem {
|
||||
item.image = source.image
|
||||
}
|
||||
}
|
||||
if case let .title(value)? = item.additionalParameters[.title] {
|
||||
if let item = barItem as? GroupBarItem {
|
||||
@ -353,7 +357,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
||||
return {
|
||||
if let url = URL(string: url), NSWorkspace.shared.open(url) {
|
||||
#if DEBUG
|
||||
print("URL was successfully opened")
|
||||
print("URL was successfully opened")
|
||||
#endif
|
||||
} else {
|
||||
print("error", url)
|
||||
@ -395,7 +399,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
||||
return {
|
||||
if let url = URL(string: url), NSWorkspace.shared.open(url) {
|
||||
#if DEBUG
|
||||
print("URL was successfully opened")
|
||||
print("URL was successfully opened")
|
||||
#endif
|
||||
} else {
|
||||
print("error", url)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user