You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace StatusItemView implementation with [NSStatusItem button] #18664
icon & text position needs to be set using [[statusItem button] setImagePosition]
getTitle
works via [[statusItem button] title]
setHighlightMode
i have no idea...
there is no custom draw function anymore, maybe drop support for this func? or worth finding a custom solution which might break again in future macOS versions?
however there is [NSButton setHighlighted] which will be reset on click - maybe a custom click handler can uphold the highlighting state?
no idea about this one... my guess is a custom click handler
getIgnoreDoubleClickEvents
correlates with setter
popUpContextMenu
maybe?
setContextMenu
works somehow via [[statusItem button] setMenu]
needs further investigation, e.g. radios, buttons not enabled (see #random channel)
[statusItem popUpStatusItemMenu] but did work.. but is deprecated yay
getBounds
works via [[statusItem button] frame]
isDestroyed
not tested, but shouldnt be a problem
Events
click
defaults to open assigned [[statusItem button] menu]
not sure if can be overriden
custom view needed for that, workaround?
right-click, double-click
custom view needed for that, workaround?
drop, drop-files, drop-text
custom view needed for that, workaround?
drag-enter, drag-leave, drag-end
custom view needed for that, workaround?
mouse-enter, mouse-leave, mouse-move
detected using a NSTrackingArea
attaching tracking area to [statusItem button] might work
Especially the events are problematic (at least from my point of knowledge). Also, theres no setter for [statusItem button]. Is there a workaround to change it to a custom NSStatusBarButton - and if so, would that help?
Activity
deermichel commentedon Jun 20, 2019
Tray Migration for macOS Catalina
Docs: https://electronjs.org/docs/api/tray
statusItem: NSStatusItemInstance Methods
destroysetImage[[statusItem button] setImage]setPressedImage[[statusItem button] setAlternateImage]setToolTip[[statusItem button] setToolTip]setTitle[[statusItem button] setTitle][[statusItem button] setImagePosition]getTitle[[statusItem button] title]setHighlightMode[NSButton setHighlighted]which will be reset on click - maybe a custom click handler can uphold the highlighting state?setIgnoreDoubleClickEventsgetIgnoreDoubleClickEventspopUpContextMenusetContextMenu[[statusItem button] setMenu][statusItem popUpStatusItemMenu]but did work.. but is deprecated yaygetBounds[[statusItem button] frame]isDestroyedEvents
click[[statusItem button] menu]right-click,double-clickdrop,drop-files,drop-textdrag-enter,drag-leave,drag-endmouse-enter,mouse-leave,mouse-moveNSTrackingArea[statusItem button]might workEspecially the events are problematic (at least from my point of knowledge). Also, theres no setter for
[statusItem button]. Is there a workaround to change it to a customNSStatusBarButton- and if so, would that help?cc @codebytere @miniak @erickzhao
sindresorhus commentedon Jun 21, 2019
You can set what events triggers the
.actionon a button withsendActionOn:.You can just check the
.clickCount: https://stackoverflow.com/a/16806632/64949