Author Archives: Marco Martin

A simple way to test Plasma themes

Graphics

Some time ago when testing the code that draws the svg themes in Plasma (like applet backgrounds, panels and tooltips) i wrote a very simple plasmoid that its sole purpose was to test that code, its very uninspiring name was SvgPanelTest, because surprise surprise it was a test for the class named SvgPanel:P
It turns out this applet can be actually useful also for theme designers that wants to test the themes they’re doing without killing plasma all the times.

Since now there is a contest to make Plasma even more gorgeous, i’ve decided to publish it in an easily buildable source package, and i hope that it could somewhat help you (yes, YOU :P) to make a beautiful theme that will make vista and osx to look as they are coming straight from the 80’s (well even if it’s a very little help :D)

You can download it here (also a kde-look page here) or from KDE’s svn in /playground/plasma/applets/svgpaneltest

Some notes:

To build it a KDE4 developing environment is needed (see the techbase article)
at least KDE 4.0.2 is required, but a recent svn snapshot is preferred.

A plasma restart could be needed to see it listed among the plasmoids, or you can also start it with the command
plasmoidviewer svgpaneltest
or, with a very recent svn snapshot (from some minutes ago actually :P)
plasmoidviewer svgpaneltest /path/to/your/theme.svg

On device notifier again

Software

Another post on devicenotifier :), so let me introduce his shiny new look:
new devicenotifier
The code derives directly from the kickoff delegate (with some fixes to RTL layouts), but the interesting part is that it has been pushed in libplasma, so all listviews in plasma that works like a menu can use it and have a consistent look (At the moment kickoff is still independent but i will port it shortly)

This will make possible for third party applets that wants to have a listview/menu that is well integrated into plasma without much hassle.
To use it you must use the new Plasma::Delegate class (or a subclass of it) and either use the roles that Plasma::delegate defines or if you can’t modify the model, use its function setRole(internalrole, yourrole) to map a role of the model to a role of Plesma::Delegate

If you want to paint additional data into an item you can subclass the delegate, and in the paint function calling Plasma::Delegate::paint and then paint the additional things in the space left empty that you can retrieve with the functions rectAfterTitle, rectAfterSubTitle and emptyRect.

That’s it 😀

ways to unmount things

Software

In the planet posts i’ll mostly blog about the little things i do for Plasma, hopefully with screenshots when possible 🙂
At the moment i’m playing around the device notifier to make it more appealing and most important more intuitive. One problem was that there was not an intuitive way to unmount removable discs/eject cds, the dolphin rmb menu is well, a right mouse button menu and the drag and drop to trash is funny but i admit it a little bit silly :D.

Now there is a little eject icon in the device notifier near to all the mounted devices, clicking on that it does the proper action whether is unmount or eject. now the look is this:

devicenotifier eject

In the future multiple icons so multiple actions will be supported and will devicenotifier will support different kind of devices it will be possible to offer an intuitive way to perform common operations, like turn off a webcam, interrupt a bluetooth pairing or well, whatever 🙂

Now the appeal part… at the moment the look sucks a little bit, also because it’s totally different from how kickoff looks, but now we’re working on a way to give all the similar plasma applets (at the moment kickoff and devicenotifier, in the future who knows) a cool unified kick-ass look, stay tuned 🙂

Crisp Plasma dialogs borders

Graphics

Since yesterday The border of plasma dialogs like the clock popups have got rounded borders also when the composite is disabled, just like tooltips before,ok not a big deal.
But what is changed is that before tooltips shape was an hardcoded rounded rectangle with a fixed shape and an also hardcoded white border and that kinda sucked…

A second problem connected to that was when compositing was active the windows only faked a non rectangular shape, but they still were stupid rectangles, so for instance you couldn’t click on a totally transparent area to make the popup go away.

Now the window shape is computed from the alpha channel of the background svg, it means now the windows have a shape similar to the one you would expect seeing the fancy transparent svg.

And it causes another problem if not well-managed, because if you use a fancy svg with cool antialiased borders, without composite you will get something awful like that (here zoomed 2x):

ugly borders

See that two black pixels on each edge? and if the radius is bigger the problem gets worse.
This because the semi-transparent pixels will become fully opaque. Fortunately the way Plasma::Theme works comes to rescue, because when compositing is not active it will load a different set of svgs when available (they are all the files in the “opaque” folder in the theme path), so for instance with tooltips when compositing is disabled it will load the following svg (here with an huge zoom):

good borders

Here you can see that the outer borders are made of big blocks that will be rendered with a size of exactly one pixel and will make the illusion of a perfectly round line, while the inner border is still round and antialiased.
So if you will make a sexy plasma theme don’t forget to provide an “opaque” version of the relevant svgs, that at the moment are widgets/tooltip.svg and dialogs/widget.svg (probably in the future there will be also krunner.svg).
these svgs must not have semi-transparent areas and they must have a pixelated border, There are some nice tutorials around on how to make a convincing pixel-based path, like this one.

What? very 90’s or eve 80’s you say? Eh, true, this is where the desktop without compositing comes from 😀

Hello Planet!

BlaBla

Hello world planet!
First of all thanks Clee for adding me so fast! For those who don’t know me (well, the mayority of you i suppose) i am sometimes a programmer of some kde-related things.
At the moment i am doing some work with Plasma (yes, i’m the one of the infamous click, drag… eject:P)

Other thing i’ve done for kde are the Polye ster kde3/kde4 widget style and Tastymenu, a kmenu replacement for kde3.

I don’t blog very often and my english is very “all your base are belong to us” but well, sometimes i will be here 😀

Tag cloud

BlaBla

Implemented a tag cloud to this website (and so phpwet) it were years i didn’t touch that crappy cms, but i can confirm my idea that i hate it but it’s the one i hate less 😛