-
Notifications
You must be signed in to change notification settings - Fork 34
Implementation of system control tray option #35
base: master
Are you sure you want to change the base?
Conversation
I am fairly new to GitHub and was wondering if you could show me how to implement this, if implement is the right word. Thanks in advance 😊 |
@Ninjien You can refer to this example project for a very simple example: https://github.com/a2/touch-baer Essentially you create a widget, which will be shown on the touchbar by utilizing DFRFoundation private APIs. This process is fairly limited, as you can only show one additional button in the system controls. (This is also used by programs such as Quicktime or XCode debugger) |
@xiamaz thanks for the PR and I apologize for not being able to check it out earlier. Overall I like the idea and I think we should incorporate it. However I found a some usability issues that I think we have to discuss and address first. The main problem is that it is possible to check "Show system controls" and then close the EnergyBar window. Because EnergyBar is an
PS: I only did some usability testing and have not reviewed the code. However I noticed in passing what appears to be a problem and will add a review comment after this message |
src/TouchBarController.m
Outdated
- (id)init | ||
{ | ||
if (self = [super init]) { | ||
_button = [[[NSCustomTouchBarItem alloc] initWithIdentifier:kControlButtonIdentifier] autorelease]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project does not use ARC, so this code will autorelease
the _button
, which could end up as a pointer to free memory.
Also the _button
should be freed in dealloc
.
Thanks for the reply. I want to continue working on the PR, if there are good ways to overcome the usability issues.
Yes, I always just relaunched the EnergyBar app. If this could be blocked by some settings. I would suggest adding the ability to show Energybar settings by long-pressing the control tray button. Still the current setting of long-pressing the date seems also to be an issue, if the user is not enabling this specific widget.
I only implemented it because I prefer the system controls, since otherwise we would need to reimplement all system control functionality in energybar, eg a IME switcher is currently missing.
I would like to keep both, since I like having access to system controls directly. Maybe we should add this as a option?
This probably because you had an esc widget enabled. If you are in the Energybar app the outer close button might be shown as another esc button.
I will update that. |
Add an touchbar option to show the system controls of the normal touchbar. This option adds an energybar button to the system controls, which can be used to expand the energybar into the application space of the touchbar.
Refactoring of control strip button code into TouchController, avoiding additional imports in the AppController. Now expanding the system modal will also hide the energybar button itself by passing the correct identifier to the present function.
…custom multiwidget
I have rebased against the current version. Are you still considering this PR or have some suggestions? |
Add an touchbar option to show the system controls of the normal
touchbar.
This option adds an energybar button to the system controls, which
can be used to expand the energybar into the application space of
the touchbar.
This way it is possible to use the system provided control button and offers a quick way to show the native touchbar controls.