The art of setting text to KStatusNotifierItem

Aaron J. Seigo aseigo at kde.org
Mon Jun 7 18:58:00 BST 2010


On June 5, 2010, Andriy Rysin wrote:
> Hmm, I am not sure if it makes sense for keyboard layout indicator to link
> to libplasma

it's part of kdebase/workspace, so it's not like it will be dragging in a 
dependency that isn't already practically guaranteed to be loaded by anther 
process.

> Though now I have one more problem (unrelated to text shadow): if the text
> is wide enough the pixmap generated seems to get bigger than the space for
> the icon in systray, and seems like KStatusNotifierItem does not scale it
> or clip it but just does not show anything at all... or am I doing
> something wrong (again :) )?

hm.. how much bigger is it? it could be that it's painting the top-left corner 
of the resulting pixmap. looking at the code, it should be clipping it ...

alternatively, for whatever reason, in kdelibs/plasma/widgets/iconwidget.cpp, 
IconWidgetPrivate::decoration could be returning a null pixmap... 

> I can do (a bit more) coding in layout indicator widget to get the font
> smaller if text is too wide, but I am not sure if I can know the size limit
> I have - now that the client code is abstract from systray UI is there a
> way to know the size of systray icon to squeeze content in?

no; nor does this make sense since the same entry may be shown in multiple 
places each with a different size. but you can provide multiple sizes of the 
pixmap in the QIcon object based to the KStatusNotifierItem::*ByPixmap(..) 
methods and the visualization should pick the most reasonable one from them.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100607/cf008d8d/attachment.sig>


More information about the kde-core-devel mailing list