The art of setting text to KStatusNotifierItem
Andriy Rysin
arysin at gmail.com
Sun Jun 6 03:17:37 BST 2010
2010/6/3 Aaron J. Seigo <aseigo at kde.org>
> On June 3, 2010, Andriy Rysin wrote:
> > On Jun 2, 2010, at 13:57, "Aaron J. Seigo" <aseigo at kde.org> wrote:
> > > look in kdelibs/plasma/paintutils.[h|cpp] and feel free to steal the
> > > code for
> > > shadowText(...)
> >
> > Thanks, that works but I had to "steal" 7 functions in 150 lines of
> > code. I've got a feeling this code might belong to some common place
> > (e.g. kdelibs).
>
> it is in kdelibs :) libplasma contains animations as well. the problem with
> splitting those kinds of things out into their own library is that they
> tend
> to become unused, deprecated, duplicated, etc, etc. it's happened several
> times in the course of ke over the last several years. but if it there is
> real
> interest, we could split libplasma into an "effects" library (though it
> really
> wouldn't be complete enough to justify calling it such a thing) and a more
> app
> focused libplasma.
>
Hmm, I am not sure if it makes sense for keyboard layout indicator to link
to libplasma so for now I just duped the code but if the code for text
shadowing is going to move to more basic lib I'll be more than willing to
link instead :)
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 :) )?
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?
Thanks,
Andriy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100605/434a2356/attachment.htm>
More information about the kde-core-devel
mailing list