1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-11 09:28:38 +00:00

ShellScriptTouchBarItem: performance optimization

This commit is contained in:
bobrosoft 2019-08-11 15:46:08 +02:00
parent 77f56df144
commit 36d1028af1

View File

@ -42,7 +42,9 @@ class ShellScriptTouchBarItem: CustomButtonTouchBarItem {
// Update UI // Update UI
DispatchQueue.main.async { [weak self, newBackgoundColor] in DispatchQueue.main.async { [weak self, newBackgoundColor] in
self?.backgroundColor = newBackgoundColor if (newBackgoundColor != self?.backgroundColor) { // performance optimization because of reinstallButton
self?.backgroundColor = newBackgoundColor
}
self?.attributedTitle = title self?.attributedTitle = title
self?.forceHideConstraint.isActive = scriptResult == "" self?.forceHideConstraint.isActive = scriptResult == ""
} }