cat /dev/maxilys

A glance in the mind of a KDE/Linux developer to see how ideas turn into code.

2006-01-05

The anthill under the blanket

First, when I write "ant", you must understand "insect", nothing more. When I want to talk about bugs, I use the word "bug". I wrote this because I think that's one of the reasons why I got censored on KDE developers. They propably didn't like the idea of somebody telling that KDE is full of bug. That wasn't what I meant but nevermind... They also probably didn't like that I wrote some KDE developers have bad taste, bad programming habits and that I wanted to hang some of them (only to my Kicker's top panel). ;-) Well, I'm gonna re-write my censored post or, at least, rephrase it.

Writing a style for KDE is easy. You almost don't even need to know C++, you just have to take the sources of a working style and to change the graphics. It's really easy. But what is hard is to obtain the result you have in mind. You can't see it but there are anthills behind your screen. And when it comes to write a style for KDE, you have to cope with 2 of them, the one above the other: the big Qt anthill in the bottom and the smaller KDE anthill on top of it.

I'm talking about anthills because you never know when ants will come and ruin your picnic (your style). Especially KDE's ants!

The Qt anthill is rather quiet and you don't see most of its activities which are filtered and re-transmitted to your style through KDE but you still have to find your way through it. Before I started writing my style, I didn't pay much attention to Qt but now I'm an expert in finding my way through its docs, its includes and its sources.

The KDE anthill is another problem. When you want to control every aspect of your style, you realize that this anthill has a lot of exits under and around the blanket where you picnic. When you write a style, it's a bit like trying to stretch your blanket to close every exit.

So KDE sources became my map to find all these exits. And that's when I started to read KDE sources that I also started to want to hang some of KDE's developers to my Kicker's top panel because of some really bad choices IMHO that interfere with the style and that you can't bypass. Especially, KDE draws some parts of the widgets by itself instead of passing the drawing actions to the style. It uses fixed colors that no style can change and if you don't like these colors, well, live with it. That's why I talked about bad taste. And, worst of it, KDE sometimes uses Qt primitive elements that shouldn't be used for the widgets. It's even written several times in Qt sources!

In the far times of CDE, it didn't show so much but in KDE 3.5, you can't miss such things. As a style writer, I also became an expert in seeing at a first glance all extraneous or missing pixels and telling if it's my fault or not. And those Qt primitiv qShadeThingies bite my eyes everytime I see one.

An example: Right click on your desk --> Configure the desktop --> Other wallpapers. That brings a dialog to directly install wallpapers from KDE-Look.org. The missing panel resizers is a problem for the Usability Department but that ugly qShadePanel around the perfectly regular tab panel but not the tabs... That's what I call bad taste. Definitively a bad choice from the developer. I even saw it recently on a KDE promotion web page. I felt a little shame since that's rather a bug than anything. And what can a style developer against such horrors? Absolutely nothing. The qShadeThingies shouldn't be used in the widgets because they can"t be styled. That's what is written in Qt sources.

There are such qShadeThingies that appear from time to time in KDE like ants on a picnic blanket. They ruin your day when you're a style developer.

My first ant invasion I had to fight for my style was the ugly etched texts. I put big red "No" signs at every exits for the etched text (a flag to set somewhere in the style) but the disabled labels kept on going out of KDE's anthill as etched text. Face to such a situation, I got a deep desire to torture some people to obtain answers to the question "Why". After a few days, I found the solution: I cut a piece in another blanket (the sources of the HighContrast style) and I sewed it to my own blanket.

Another ant invasion what the fact the content of the buttons was shifted under a mouse click. Once again I put big red signs everywhere (some static values to set in the style). That worked rather well but not perfectly. Somewhere in the KDE anthill, there are some ants that keep on shifting contents from time to time and I can't prevent them from doing so unless I straighten some tunnels (patch KDE itself). Bad taste, bad choices, whatever. Somebody just didn't imagine there could be other ways to show that a button is pressed... and my blanket isn't stretchable enough to cover this.

I'm a perfectionist --some would say a maniac-- and I fought quite some ant invasions to get close from the style I have in mind but I also discovered that there are some battles against KDE that my style can't win --unless I start to patch KDE but this is further that I intend to go.

I just finished today the spin widget I left alone for a long time with no other reason than I didn't feel like working on it. And I'm now definitively sure I want to hang the author of KSomething to my Kicker's top panel (name changed in order not to get too personal) because of the the way he uses the spin widgets. Instead of 2 spin widgets, he uses only one which contains 2 variable fields and only the part containing the arrows in front of it. Sorry but that's just plain ugly with the majority of the styles I know, including mine. But what can you do when a developer decides to take parts of widgets and to patch them together? Nothing. This ant is the size of an elephant and no blanket can hide it.

No matter how hard you try to close every exit from KDE's anthill, there will always be one developer digging new tunnels behind your back... with explosives!

But don't get me wrong. I may sound a little bitter but that's only because I feel some frustration not to be able to do whatever I want with my style --as I expected. To develop a style still remains my most enjoyable developer's experiment with KDE. I feel like the writer of a script at the premiere of his movie... every day, every minute. I can't get tired of seeing my ideas (my widgets) projected on the big screen. And they look even better on an HTML page with unusual colors. That's one of the reasons why I now definitively prefer Konqueror over Firefox... besides Konqueror is a thousand times faster to start.

Last thing to say: All the violent acts I describe in this blog should be understand as metaphoric acts, of course. I'm not a violent person... except with words.

Now, excuse me but I have an ant as big as a lion on my blanket and it wants the chicken I brought for my picnic. ;-)

0 Comments:

Post a Comment

<< Home