The art of setting text to KStatusNotifierItem

Marco Martin notmart at gmail.com
Thu Jun 3 11:12:02 BST 2010


On Wednesday 02 June 2010, Andriy Rysin wrote:
> Got a little problem with this bug
> https://bugs.kde.org/show_bug.cgi?id=240225
> Looks like keyboard layout is the only systray item which needs to set the
> text (if show flag is unchecked) and currently the text is drawn as an
> icon, the text looks much cleaner than in 4.4 when it was to be overlayed
> and thus needed a halo to be visible. But there's a problem with darker
> themes as text is drawn with black and it becomes invisible.
> 
> Now there's no nice and quick way to fix it as I can see and there are
> several solutions I could anticipate:
> 
> 1. Allow setting text to KStatusNotifierItem (and let it deal with picking
> appropriate font size, color etc) - architecturally nice solution and very
> nice for the client app, but keyboard layout indicator being the only
> customer for this I don't see this implemented (unfortunately for me)

That is the solution proposed by Aurelien basically.
I kinda share the concerns of Aaron tough, once is possible to do that, how to 
make sure it would be used only when is eally necessary and not abused?
for the unread mail use case i would personally have and extension with some 
type specific metadata, for communication related items it would be just 
restricted to unread messages (and maybe other data who knows)

> 2. Drawing text halo, e.g black text with white halo - I tried quickly and
> could not find with a quick and reliable way to get the nice text: if you
> draw the text black and halo white then (even if you manage to get halo
> look ok with the font face and size you don't know) the black will look
> great on light background but the white (halo'ed text) will look much
> worse on darker themes and vice versa

yeah, i reckon there is no clean way at the moment to make the keyboard 
indicator more integrated, a generic text property would solve it, but i 
continue to think there should be something else that can be done

Cheers,
Marco Martin




More information about the kde-core-devel mailing list