Move icon badge code to toolkit/widget

NEW
Assigned to

Status

Thunderbird
General
--
enhancement
10 years ago
9 years ago

People

(Reporter: Gijs, Assigned: Matthew Gertner)

Tracking

Trunk
All
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
It would be nice if the "icon badge" functionality that Thunderbird uses to show the number of unread messages on the application icon on mac was available in a general form, outside of mail code, instead of in http://lxr.mozilla.org/mozilla/source/mailnews/base/src/nsMessengerOSXIntegration.cpp

The mail-specific code (figuring out the number of unread messages) would obviously remain there, but it would be cool to have a generic API that took an image or canvas and badged that onto the current application icon. This would have to be implemented outside of mozilla/mailnews. I'm guessing toolkit or widget would be the best place, but I'll leave the ultimate decision to someone else.


I tried to file this as a toolkit bug, but I realized that I couldn't find a reasonable component (the best I could do was XUL Widgets or XRE startup, both of which are still miles from what this bug is about). If someone knows where this should be instead, feel free to move.


CC-ing shaver who concured on IRC yesterday that this would be a good idea.

Finally, if nobody has gotten to it by March, I might try to spend some time on this then.
Ideally it would take an image url which could then be a chrome url or a data url exported from a canvas.
(Reporter)

Comment 2

10 years ago
Actually, to be fair, the moving bit (after finding out where the code was) was totally Mike's idea. But yeah, generic APIs for stuff like this would be good. And yes, a URL may be better...
(Assignee)

Updated

10 years ago
Assignee: nobody → matthew
(Reporter)

Comment 3

9 years ago
Prism implements this now, too! Can we please please unify these implementations? :-)

(accusatory stare at Matt)
(Assignee)

Comment 4

9 years ago
Well in my defense all I did was copy the code from mailnews. It's pretty basic, uses deprecated APIs and frankly I don't find the badge particularly attractive. Leopard has some new APIs that should help greatly: http://developer.apple.com/documentation/Cocoa/Reference/NSDockTile_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDockTile.

Some questions:
- Do we need the capability to badge with an arbitrary image or just text? Some use cases might be helpful here.
- Can we live with the mailnews code for <= Tiger and use the new APIs for >= Leopard. This makes sense to me, though it means of course that older systems would only support a subset of the new API (if we support arbitrary images).
- Should we try to unify with other desktop-specific code (like badging a tray icon on Windows)?
- Where should the interface live?
- Where should the code live?
You need to log in before you can comment on or make changes to this bug.