mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: allow TouchBarButton instances to be disabled (#20945)
* feat: allow TouchBarButton instances to be disabled * Update touch-bar-button.md
This commit is contained in:
@@ -196,6 +196,7 @@ TouchBar.TouchBarButton = class TouchBarButton extends TouchBarItem {
|
||||
this._addLiveProperty('backgroundColor', config.backgroundColor)
|
||||
this._addLiveProperty('icon', config.icon)
|
||||
this._addLiveProperty('iconPosition', config.iconPosition)
|
||||
this._addLiveProperty('enabled', typeof config.enabled !== 'boolean' ? true : config.enabled)
|
||||
if (typeof config.click === 'function') {
|
||||
this._addImmutableProperty('onInteraction', () => {
|
||||
config.click()
|
||||
|
||||
Reference in New Issue
Block a user