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
Add TouchBar Support #8095
Add TouchBar Support #8095
Conversation
@zcbenz / @kevinsawicki / @zeke Given this compiles without any issue on my laptop I think the OSX build machine needs to have it's XCode updated? |
This looks great! Will try it today with N1. You're correct - this will need to be built with the target SDK set to MacOS 10.12.1 with the most recent version of Xcode. I wonder how often Travis updates Xcode... |
@bengotow It looks like travis-ci already has support for the required version of X-Code |
Would like to point this cool app, It emulates TouchBar on all mac (as it claims). So, if you need to do some testing on a mac without TouchBar, you could do it now. Edit: Or, you could use the latest xcode with the latest sierra and open the TouchBar emulator window |
In order to reduce API overhead (keep methods minimal) I added a method to all |
@MarshallOfSound hey, I'm attempting to take this branch for a spin and am running into some issues.
When I start up the project, |
Hi @bcoe! |
@bcoe This part is probably where you went wrong
There isn't currently an easy way (that I know of) to link the version of Electron you built with an the If you launch the sample application (that is generated during the build) do you get the touch bar buttons and such? |
This is amazing progress :D Any chance the popover can allow for options (if it doesnt already - I didn't see) to mimic the volume and or brightness popovers? Or the animated popover for the default function keys? |
@ktiedt I briefly looked into mirroring that kind of functionality and the TLDR is.
|
Thanks @MarshallOfSound for the awesome TouchBar support! Was wondering if someone tried a button with an image? I rebuilt the default app with the button below (in
|
@MarshallOfSound thanks for your help, you're right I was not using the correct version of electron to test. My testing went pretty well; I got things running with hyper-term for a proof of concept: https://twitter.com/BenjaminCoe/status/830607339577225218 some feedback for you:
amazing work! can't wait for this to eventually land. |
Will experiment with that, I have an example locally which implements a clock in a label element (one of the local testing things I did) and it appears to update nicely.
The best I can do really is expose the core API's of the touch bar, anything super advanced requires custom views in native code and can't really be generalized well enough.
First off, that would be aswesome, just having like Secondly, what exactly do you need in order to achieve what you want to do? Can't this kind of text output be done with labels? |
According to the spec, the touchbar isn't supposed to be used for displaying information. It's strictly for controls. |
@matthewdias However, when using QuickTime for a screencast, the touchbar displays the length and the size of the recording, which is pure information. |
Just found a way to add button to Control Strip, but it's private API: https://github.com/a2/touch-baer Probably only these applications are using it: Xcode, TouchSwitcher, Rocket Currently it's I feeling the best experience for use TouchBar, but I think it will break the experience of |
Any updates for this PR? |
The last update was 2 months ago, any one approach to this feature too? |
@Cryrivers @PeterTeng This PR is currently blocked by the inability to build Chromium with the required target SDK. See #8280 (comment) |
@MarshallOfSound perhaps this can be unblocked using this technique, https://cs.chromium.org/chromium/src/ui/base/cocoa/touch_bar_forward_declarations.h |
@kevinsawicki Will look into next week some time (unless someone plays with it first). Will have to downgrade my SDK and see if it still compiles 😆 What exact combinations of SDK / xCode do the build machines use again? |
I've tested this on El Capitan to verify it works on older OS versions and also machine without a touch bar. Thanks @MarshallOfSound for your awesome work on this 👍 🎉 🥇 It will be included in the next Electron beta release, 1.6.3. |
Nice job @MarshallOfSound and @kevinsawicki ! I will retry a button with an image file, this did not work for me a few weeks back, likely because of my png. Maybe add an example with a working image?
|
The property is |
Ah ok, although
https://developer.apple.com/reference/appkit/nstouchbar#2647104 |
Nice job @MarshallOfSound and @kevinsawicki !!!! |
I tried master branch and this really works nice! Thank you. |
So here goes 👍
I've still got to add docs for all this but basically this PR adds support for
window.setTouchBar(bar)
new TouchBar([...])
new TouchBarButton(...)
new TouchBarColorPicker(...)
new TouchBarGroup(...)
new TouchBarLabel(...)
new TouchBarPopover(...)
new TouchBarSpacer(...)
new TouchBarSlider(...)
Still to do
Add support for the "customizable" attribute (pretty major thing missing but it requires some good docs and some magical techniques)TouchBar
Implement aNSCustomTouchBarItem
with anNSScrubber
as the view (this is quite a big task, not sure if it is even possible to declare at runtime)Implement aNSCustomTouchBarItem
with anNSSegmentedControl
as the view!Closes #7781