The Road to KDE 4: SVG Rendering in Applications

Since KDE 4 development is in full swing with plans for a KDE 4.0
release sometime later this year, I thought I'd put together a
weekly piece entitled The Road to KDE 4. The idea is to
have a short overview of one or two of the features that show
progress in KDE 4. For my first issue, the goal is to show off some of the great SVG work that has taken place so far. Read on for the details...

Since many features are covered in personal blogs via the KDE Planet, I'll try to cover those that receive less public coverage, or need more public coverage.

The first thing I'd like to point out is that KDE 4 builds, installs, and runs well enough that I can test many of the ported KDE 3.x applications, and most of them are pretty stable. The real joys come when you look more closely at those improvements that are afforded by the changes in the base technologies. Today, I'll talk about one of the eyecandy features provided by Qt 4: SVG rendering in applications.

There are many other KDE applications reaping the benefits of SVG drawing to make them more pleasing, and more scalable. Check out some of these posts:

  1. Albert Astals Cid renovates blinKen
  2. KDE 4 games SVG status wiki

Today I'm going to focus on a handful of apps, providing before and after screenshots to compare the KDE 4 development version (pre-alpha stuff) to the existing KDE 3.5.5 equivalents.

To begin, I'll look at the KDE System Guard, a useful utility packed into KDE that you can pull up as 'ksysguard'. It does all sorts of neat things like display charts of memory and CPU usage, and a process table (also accessible via the Ctrl-Esc keyboard shortcut).

Here's how it looked in KDE 3.5.5:

And now, in the KDE 4 development series (the lines are antialiased, the graphs are translucent and the backgrounds are SVG):

As you can see, it is visually much improved from its current and very functional form.

Next we'll look at some of the diversions shipped in the kdegames package. KAtomic is a puzzle game. It's fun, semi-educational, and could definitely have used an image overhaul. Here it is in it's spartan KDE 3.5.5 glory:

And now, with much improved oxygen-style graphics in the development series:

KMahjongg ships in the kdegames package, and is a staple of puzzle gaming. Here it is from KDE 3.5.5 looking like a game that escaped from the
Best of Windows Entertainment Pack

And now, with a much-improved SVG-powered tileset in the
development series:

And last but not least, is one of the more frequently used parts of KDE: the "Run Command" dialog (Alt-F2). Previously this:

Now, thanks to desktop interface guru Aaron Seigo, it's a SVG themable, really slick element of the Plasma desktop. Still a work in progress, but you'll get the idea from this screenshot.

Until next time folks, when I reveal yet another KDE 4 feature under development. Cheers.


by Morty (not verified)

>(ii) please give me an example of the said application.

The most obvious, KWrite. Very handy if you wan't to quikly edit a configuration file. The use cases for this functionality are extreamly numourus.

I'll even give you one for (ii) and (iii) at the same time, it's a nice way to start Minicom (if you run Suse and don't change the default access rights).

by apokryphos (not verified)

With regard to kwrite, I don't see why you shouldn't be able to just right-click -> edit as root, which is what a normal user would do. They *wouldn't* alt+f2 -> kwrite /etc/some/file and select "run as different user". The users that know about using paths that confidently (and know about editing system-wide config files) know about kdesu.

by Morty (not verified)

The option is for real normal users, not your "normal". The way you talk it seems like you actually mean simple or novice users. Normal users are(or very soon gets to) a level above novice, but far from expert user. This option is for those users, they will have a easy way to run as root without knowing about kdesu. Which is rather more obscure and harder to learn, while cliking the options button is not. Your "normal" would not know about running as root or alt+F2 anyway.

In normal use this option is not needed, that's the whole reaseon it's hidden too. That's usability btw, it's only there when you need it. It does not degrade speed or create confusion. But *when* you need the functionality it's easily accesable, even for non-expert users(For instance a ordinary user having run his home PC on Linux a year or two, but not a sysadmin wizzard).

And personaly I find using the option both easier and more logicall than: alt+F2 kdsu kwrite /etc/somefile

by otherAC (not verified)

>>With regard to kwrite, I don't see why you shouldn't be able to just right-click -> edit as root,

If I right click, i don't see an option 'edit as root'

And if i want to create a new file as root, that option would not help at all to gain root privileges.

Furthermore, every action on a computer system can be done in several different ways. (like with pasting text, you can use the middele mouse button, the context menu of the right mouse button, the past icon in the toolbar or the menu option [edit -> paste]), so why should we want to strip a (hidden) option from krunner, just because there are other ways to perform the desired action??

by Joe (not verified)

2.) Run as root? kwrite /etc/apt/sources.list or
/etc/init.d/whatever restart

The point is, my boy, you are telling ME how I am supposed to run my shop? Fart on that. You have no clue how most people use computers, so don't say "should".

by apokryphos (not verified)

Er, yeah, you really run that in alt+f2? Good luck, since it won't give you *any* output. Great use that is. If it errors out, you won't know, if it succeeds, you again won't know. I'm quite sure you run your /etc/init.d/ scripts from the terminal.

> You have no clue how most people use computers, so don't say "should".

Evidently. I "have no clue" that alt+f2 gives you absolutely no output, unless you select the terminal option as well (which I already gave an argument for not having).

by Roberto Alsina (not verified)

Check the "run in console" option in Alt+F2

by Phase II (not verified)

I like how you can talk stuff away. "Practically never", "should never have to be", "obviously doesn't need to be" or simply "don't think they should be"... I'm totally hooked. Next time I'm sitting in front of some longer TODO I try to apply your relieving attitude.

by Hobbes (not verified)

The ability to run applications as a different user is really convenient for me! I have a personal (or "home") account and a professional (or "work") account on my laptop. I am not going to mix them! And, sometimes, I need to run a graphical application from the other world... For instance KMail, Korganizer or Kaddressbook, for obvious reasons. With Krunner, I save time.

Thanks for the application!

by pascal (not verified)

Actually I agree with you. Only problem is that KDE is all about choices and the extra options are not even really visible unless you look for them. But maybe you are right, maybe nobody are using this functionality.

On another note: The built-in calculater in krunner ROCKS! I simply love it. It's so fast and handy when I need it.

by pascal (not verified)

Well, If I had refreshed the page I would have seen that lots of people are using it. And it seems like a cool feature to be able to open kmail as another user quickly.

by ac (not verified)

I agree, this should be a "tip of the day", till now my girlfriend and I used start new desktop, but for a quick email check, this will be very helpfull, thanks

by Lessismoreisless (not verified)

being able to switch to another user account more quickly would help too though...

by Felix (not verified)

(i) Is very useful if you have more than one non-root account and don't like to switch desktop sessions
(ii) Maybe programs should ask for a root password, but kde cannot know if all apps really do this. The option doesn't hurt,
(iii) Very useful for me, as it is better as starting an extra console. Useful for debugging.
(iv) Also useful for people don't understanding how to use nice/renice
(v) Some users might need this, I not, but it doesn't hurt.

Most of the time, having more options is better, at least for me. I really like desktops/applications where options are hidden for normal users how cannot understand and use them, but are easily available for me. I don't see a problem in having an "Options" or "Advanced" button. It gives users the choice !


by apokryphos (not verified)

I agree with a lot of your points that perhaps these options don't hurt. It is true that in krunner they are less obtrusive.

No harm in questioning if each one is needed though, too.

by Andre (not verified)

True, but I guess that as long as the features are not in the way, and they are usefull for *someone*, it would be a good idea to keep the feature.

by Tyson (not verified)

Excuse me, but I use (i) all the time. One of the best things about it is that it seems to handle all the details of the X connection (i.e., authorization). The only problem I have with it is that tab is disabled from selecting the options box after you use the drop down box that pops up when you start typing.

Personally, I think you could use reading some of the criticism of over simplification.

- While it is true that users only uses about 10% of the features of an app, the 10% differs enough for each user that their union covers pretty everything present. Taking the intersection of all the feature sets used by all users and remove everything else just winds up leaving everyone disappointed.

- Being a power user is forever; being a novice user is just a passing phase on the road to being a power user. Killing the features that those that actually use your apps more than just in a passing fancy use is not cool at all.

- Usability is not about killing features. Usability is about organizing features.

In short, please stay away from my apps! : )

by Golodh (not verified)

Please please ... the dialogue for KRunner is good as it is.

The remarks that one "should never" run or have to run application xyz as root mean precisely nothing to me. I have a few applications that need root access. And as long as Krunner asks for the root password the responsability is where it belongs ... with whoever gave out the root password. In my case that would be me. I don't think that developers should interfere in this matter.

And another thing. I notice that the example application shows signs of gratuitous styling of the worst kind. Whereas the look and feel of KRunner for KDE 3 is neat and functional (as if it was designed for me to get something done without fuss instead of as a programmer's show-off), the picture of the same application under KDE4 has this totally superfluous picture of a gear, much wasted space, obtrusive colouring, an awkwardly small business area, and a stealth button for options. Promise me one thing please ... if you are going to implement this to show off your theming powess, do provide a theme that brings back the KDE3 look and feel ... and make it default so that I never have to look at such styling monstrosities again please. I mean it. I thank and respect you as a developer, but I _really_ don't want you around as a stylist.

The KDE3 look currently resembles that of Windows, and that is a good thing. Because ... for better or worse, that plain functional WIndows look has been tested and vetted by a lot of ergonomics experts. And what they have done is to remove clutter and to make / keep the look and feel functional. Besides it reminds people of Windows and makes them feel a bit more at ease with Linux. So on behalf of the my users (and those I'm trying to convince to become Linux users) no fancy funky theming please ... and keep the look-and-feel as Windows-like as you can.

They've gotten used to it, and they *hate* it when developers change the layout of basic applications just to indulge in some random restyling. And I have to say that I sympathise.

So please ... make it scalable if you must, make it themable if you want, but please please don't touch it's looks, and keep all the options in.

by otherAC (not verified)

>> the picture of the same application under KDE4 has this totally superfluous picture of a gear, much wasted space, obtrusive colouring, an awkwardly small business area, and a stealth button for options.

as stated before, the backgrounds used in the screenshots are for development purposes only, just to show what's possible with svg.
They will be replaced with something more sensible

by Ben Morris (not verified)

These are indeed seldom-used features. This is exactly why they are hidden until you press the Options button. If you find too many options annoying or confusing, you can just try not to press Options. I personally like those options and use at least three of them from time to time, and while I can do any of them by opening a terminal emulator, I find it more convenient to start apps or run commands that way. Maybe krunner doesn't *need* options, but why shouldn't it have them anyway? We don't actaully *need* to be able to change the desktop background.

This is part of why I prefer KDE to Gnome. I refer you to the stuff Linus said about Gnome's print dialog. Basically, potentially useful options were removed, to avoid causing confusion. I couldn't see why they didn't just do exactly what krunner does: hide the advanced options till you ask for them.

by Joergen Ramskov (not verified)

That was a neat little article - looking forward to the next!

How much will actually be rendered with SVG? yeah, I know that is probably unknown, but what is the goal then? :)

by Johann Ollivier... (not verified)

As much as possible ;)

More seriously, i'd like to have (and i plan to do) all kdegame/kdeedu in SVG with an oxygen style, and several other things (finish ksysguard, krunner, umbrello...). But it will be hard to make them all for kde4.0 i fear, and there are still missing maintainer for some games.

by Joergen Ramskov (not verified)

Thanks for the answer. I know that KDE 4.0 is just the start, just look at how KDE 3 has evolved over time :) I think the same will happen with KDE 4.0 - it will be an amazingly good base to build from!

by Lans (not verified)

Of these four, I think KMahjongg has improved the most and looks most mature.

Ksysguard looks nice, but I really dislike the background.
KAtomic needs, as somebody already said, some work (and love). I think it is the black blocks (walls) that look a little bit.. too much?
And Krunner, this one was new to me. Looks pretty cool, kind of reminds me of Katapult (which is great). I wonder if it works the similar way?

Well, to sum everything up, it looks promising. Yes, there are many things to be improved, and I look forward to see the result.

by otherAC (not verified)

>> Ksysguard looks nice, but I really dislike the background.

As stated in replies at other dot articles: the background are for testing purposes only, the final background has not been made/released yet.

>> And Krunner, this one was new to me. Looks pretty cool, kind of reminds me of Katapult (which is great). I wonder if it works the similar way?

Never seen krunner?
Try pressing [Alt][F2] in KDE (works since kde 2 or earlier)to start it.

by Lans (not verified)

>> Never seen krunner?

Ah, I meant I haven't seen the new Krunner.Or whatever it is called now.

by otherAC (not verified)

there is no new krunner

by Troy Unrau (not verified)

Yes there is...

The old run dialog is part of kdesktop, but with plasma in the works, it needed to go the way of the dodo. So krunner, a new application will take over the run dialog (and, I think, screen locking once it's implemented). It is 100% new.

Everything else in the article is a port of KDE's existing apps to use the new architecture.

by otherAC (not verified)

True, but the screenshot in this article is just krunner with a different skin, not a successor with different skills.

by Aaron J. Seigo (not verified)

what is everyone smoking in this thread? =)

there is no krunner in kde3 (or 2 for that matter).
the screenshot is of a completely new application that shares zero lines of code with the old implementation right now (though that will change in a bit as i'll be bringing over some of the options implementations for command execution).
the new skills of this successor include being able to have multiple consumers of the entered text each of which can offer possible matches (think: search). it will also include such things as access to servicemenus (of konqi's action context menu fame). and it already does things kdesktop fails to do such as restart reliably in the case of a crash =)

by Lans (not verified)

Will there be "plugins" that add support to or example Calculator (this one is currently already in alt+F2), add songs to Amarok, chat with someone in Kopete etc.? Kind of like the current Katapult. :)

by Michael (not verified)

Guess that's what he meant with the "consumers".

by The guy who mad... (not verified)

Yeah, those SVGs look hella nice, but to fair you should compare them with the "Traditional" tileset in KMahjongg (with the "Wood" background, naturally). If I had my druthers, I would have made it the default years ago. It was hard enough getting the damn thing accepted in the first place, though. :-)

I guess it's time to start working on an SVG version now... :-P

by Shamaz (not verified)

If you think the default tileset is not so good, there's already a "classic" SVG tileset done. You can see it here :
It looks more like your "Traditional" one. And I think you can quite easily to edit this "classic" tileset to make it more "Traditional"-like. Good luck :)

by The guy who mad... (not verified)

There are some similarities but it looks pretty different from "Traditional." I'll have to take a closer look at those tiles. ;-)

And yes, "Default" is ugly, ugly, ugly. That's the whole reason I went to the trouble to create "Traditional" and have it included in the base package--I thought KMahjongg deserved to have a little eye candy. ;-)

by UglyMike (not verified)

Waw!!! Never really looked there...
And you're right of course: Traditional tileset with Wood background (and Tile Shadow) already make KMahjongg look a LOT better. Why was this never made the default setting? Looks like a no brainer to me!! Thanks for your contribution.

by UglyMike (not verified)

....too bad Shisen-Sho doesn't offer the same customizations.

by Mauricio Piacentini (not verified)

Well, actually it does now, in the KDE4 trunk. It shares the tileset rendering code and art with KMahjongg, so you will be able to use the same SVG tiles and backgrounds.

by MM (not verified)

But what about the performance of especially ksysguard (e.g. when the system is already swapping and one needs to kill a process)?

However, it looks really great.

by otherAC (not verified)

you can start the version of ksysguard without the graphs, with the commmand 'kpm' or the keystroke ctrl esc

by MM (not verified)


by JohnFlux (not verified)

When you are looking the process list (which is what shows first when you launch ksysguard), then the hidden graphs require (practically) no cpu etc (they log a bit of data but that's it). In particular, the svg's etc are rendered until viewed.

I have spent a large amount of effort to try to ensure that ksysguard is usuable even when the machine is going crazy. It's not perfect and there's a long way to go, but it's not so bad as it is.

by MM (not verified)

Thanks for your reply. But I am not so much concerned about the graphics themselves, but about loading, linking and initializing of the appropriate libraries used to display them. Are they loaded dynamically only when they are really needed?

However, good work.

by John Tapsell (not verified)

Yeah, it means it has to link against QSvg etc.. but all those libraries should be already loaded etc so I don't konw if it's a big deal

by MM (not verified)

I'm not sure how linking really works on Linux. Is it correct to say that one special dynamic library is loaded once for all processes on that machine (or at least for that user on that machine) (prefetching etc.)?

If so, IMHO it may depend on whether the libraries are swapped out (to disk) or not, and the more is going on on a machine, it becomes more likely that they have to be loaded from swap space to RAM...

If it is statically linked it seems clear to me that it has to be loaded again.

Maybe there is a chance to load the libs dynamically when they are necessary/used only, so that for startup and display of the process list, the libs aren't loaded (and maybe in a further step to not load them at all, e.g. when the machine is already slow, and to use "traditional" display (without svg) instead)?

by Felix (not verified)

I also hope that this will be possible, but personally, I prefer a console (not konsole ;)) in such a case, e.g. xterm or Ctrl+Alt+F1

by MM (not verified)

Yeah, the problem with Ctrl+Alt+F1 is that one has to login first. Konsole is okay too if it is already running, IMHO.

by BJ (not verified)

Really like the use of SVG!

About the new System Guard, the graphs now have titles in
the graph itself as well as above it. Also the 'Load Average' title
is missing its first letter. I know this is probably a minor issue
but I see this kind of annoyance regularly in graphical user interfaces,
KDE is no exception.

What would also be nice for the System Guard IMHO would be an x-axis
scale, so you get an impression of how long the history is you are
looking at.

by Ben Morris (not verified)

Rough edges happen in alpha stuff... They probably haven't even looked for that sort of issue yet. However, the time-axis idea would be very useful.

by Felix (not verified)

Thanks for this great summery ! I really missed easy to get informations about the progress of kde4.