-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Extending Tray [$500 awarded] #1874
Comments
👍 |
I'm looking into this and I found out there is no reliable way to get general access to the view associated with the tray status icon across all platforms (and even across different versions of the same platform); also the tray icon could be hidden (like on Windows where tray icons often are placed in an extended area) so in that case a What I think instead is a viable solution (and also makes sense usage wise) is to have
On Mac OS X we can find the position of the status item (as it is view associated with /cc @rogerwang @tommoor |
- Add a parameter to the `click` event of the `Tray` API object containing the coordinates of the tray icon/mouse pointer. The parameter has `x` and `y` fields for the coordinates. On Mac OS X the coordinates always refer to the position (lower left corner) of the tray item (NSStatusItem). On Aura (Linux, Windows) the coordinates refer to the cursor position (which would be inside the bounding box of the status icon but with slight differences depending on where effectively the user clicked). Usage example: tray.on('click', function(pos) { // pos.x is x coordinate of the tray icon // pos.y is y coordinate of the tray icon showCustomTrayMenuAt(pos); } FIX nwjs#1874
- Add a manual test and an example usage (tray only application with a custom tray menu) of the position parameter in `Tray` `click` event as discussed in nwjs#1874
- Add a manual test and an example usage (tray only application with a custom tray menu) of the position parameter in `Tray` `click` event as discussed in nwjs#1874
I made a little Proof Of Concept: So it is finally possible to do this with node-webkit 0.11.3 |
@FWeinb very nice, this will be helpful for folks 😄 |
@FWeinb neat! This could definitely go into a gist and be referenced from docs; also the templating of icons on dark menus is nice :-) /mf
|
@mrfabbri Thanks! |
It's rendered hi res here, although in your demo there is a drop shadow filter which makes it look blurry. If I remove that it's crisp On Wed, Dec 17, 2014 at 3:06 AM, FWeinb notifications@github.com wrote:
|
@FWeinb Thanks, great example! |
This isn't working on the latest build (version 15). The line that tries to make use of the position data freezes the application. The above proof of concept is dead. At least, it isn't working for me on a Mac OS X system. |
CC @ghostoy |
There are several recent changes that break custom tray window apps (another example here: https://github.com/zcbenz/nw-sample-apps/tree/master/custom-tray-menu) including the deprecation of the |
I'm just starting out with node-webkit.
Is it possible to extend the Tray to have an view inside it?
![63ff50f8-8a39-47e4-9968-1b557ac95c29](https://cloud.githubusercontent.com/assets/81863/3004168/b6c50f8a-dd81-11e3-9bcd-7a89cc1d60c0.png)
I'm trying to have a small view inside Taskbar Menu. Any small pointers is much appreciated.
The $500 bounty on this issue has been claimed at Bountysource.
The text was updated successfully, but these errors were encountered: