-
Notifications
You must be signed in to change notification settings - Fork 28.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test: macOS touchbar #34760
Comments
This is super cool! Is there a way for our main-side code to easily participate in there? Ideas:
@bpasero : The only surprising thing is that contributing an icon paints both the icon and the text... The space will quickly run out ... Perhaps it can only paint the icon as we do in other places. |
@alexandrudima yeah we do not show the label when an icon is present, in your case I suspect an issue with how Electron decides to update the touch bar entries when a change occurs on that level (e.g. I added a label and then added an icon and briefly I saw both showing up but after a full restart only the icon was showing up). It is very simple to contribute more entries based on a specific context, e.g. see the code for the debug buttons here. Basically all you need is a command and a context. Space is indeed a bit limited down there and I am trying to optimize for a good experience when the debug toolbar is fully visible. It seems that when there are too many items in the touch bar, the last items will simply be removed from the bar. Unfortunately per group of buttons, the entire group will disappear, not just the last buttons. In the case of the debug tool bar this would mean to loose the entire tool bar. Maybe file new issues for your suggestions so that we can keep them in mind. |
It would be great to get a first class API to play with TouchBar. Perhaps, a subset of whatever Electron offers. I feel its very restrictive to have access to TouchBar via |
Refs: #14653
Complexity: 3
We enabled support to show commands (with either icon or label) in the macOS touch bar. The commands are context aware and registered per window (switching windows will update the touch bar).
Built-in
Extensions
Extensions can add new commands via the menu API by registering to the
touchBar
location:Verify you can register commands to the touch bar and then
when
condition is respected. The touch bar will always take the context of the active editor to resolve the commands. The resource of the active editor will be passed to the command you register as context.Note: your command can either have a label or icon. If you chose an icon, make sure to use PNG, as SVG is currently not supported.
The text was updated successfully, but these errors were encountered: