setBadgeText position & transparent?

2,101 views
Skip to first unread message

Developer09

unread,
Sep 10, 2010, 4:18:13 PM9/10/10
to Chromium-extensions
I would like to write some text over my extension icon like
setBadgeText does it but. But the problem is that setBadgeText doesn't
allow to set a transparent background and the position of the text
can't be set also.

Does anyone know an alternative how to handle that without using
canvas?

Thanks

Arne Roomann-Kurrik

unread,
Sep 10, 2010, 4:29:00 PM9/10/10
to Developer09, Chromium-extensions
Without using canvas this isn't possible.   I'd argue that badge consistency across extensions is a desirable feature for end users.

~Arne



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Derek 囧

unread,
Sep 10, 2010, 11:55:39 PM9/10/10
to Chromium-extensions
You CAN make the badge transparent.

Please read the document, it's in there:

http://code.google.com/chrome/extensions/browserAction.html#method-setBadgeBackgroundColor


You can set the background color to a defined opacity.

Enter this before you set the badge text:

chrome.browserAction.setBadgeBackgroundColor({"color": [225, 0, 0,
100]});

The [255, 0, 0, 100] (or you can call it RGBA) means the color is red
and opacity is 100 out of 255 (half-transparent).


The position of the badge can't be set by the extension so sorry. :(

Hopes this will help you.

Derek




On 9月10日, 下午3時29分, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> Without using canvas this isn't possible.   I'd argue that badge consistency
> across extensions is a desirable feature for end users.
>
> ~Arne
>
>
>
>
>
>
>
> On Fri, Sep 10, 2010 at 1:18 PM, Developer09 <marc.skaw...@gmail.com> wrote:
> > I would like to write some text over my extension icon like
> > setBadgeText does it but. But the problem is that setBadgeText doesn't
> > allow to set a transparent background and the position of the text
> > can't be set also.
>
> > Does anyone know an alternative how to handle that without using
> > canvas?
>
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > .

Arne Roomann-Kurrik

unread,
Sep 13, 2010, 2:30:05 PM9/13/10
to Derek 囧, Chromium-extensions
Ah, you're completely right.  Sorry about that.

~Arne

To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

Aaron Boodman

unread,
Sep 13, 2010, 11:43:14 PM9/13/10
to kur...@chromium.org, Derek 囧, Chromium-extensions
Does that make the badge completely transparent? I thought the way the
badge code worked was that we overlap a greyscale image on top of a
developer-defined ARGB color. Even if you set the background color to
full transparent, you'll still see the greyscale pill image floating
in space.

- a

Derek 囧

unread,
Sep 14, 2010, 6:42:53 PM9/14/10
to Chromium-extensions
I don't know about the image floating(i think it's the shadow maybe)
but if you think it's a bug then you can report it at crbug.com.

Another thing is that, it's not ARGB, it's RGBA. :)

Derek

> Does that make the badge completely transparent? I thought the way the
> badge code worked was that we overlap a greyscale image on top of a
> developer-defined ARGB color. Even if you set the background color to
> full transparent, you'll still see the greyscale pill image floating
> in space.
>
> - a
>
> On Mon, Sep 13, 2010 at 11:30 AM, Arne Roomann-Kurrik
>
>
>
>
>
>
>
> <kur...@chromium.org> wrote:
> > Ah, you're completely right. Sorry about that.
> > ~Arne
>
> > On Fri, Sep 10, 2010 at 8:55 PM, Derek 囧 <derek1...@gmail.com> wrote:
>
> >> You CAN make the badge transparent.
>
> >> Please read the document, it's in there:
>
> >>http://code.google.com/chrome/extensions/browserAction.html#method-se...
> >> chromium-extensions+unsubscr...@chromium.org.
> >> For more options, visit this group at
> >>http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org.
Reply all
Reply to author
Forward
0 new messages