cat /dev/maxilys

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

2006-01-30

One step too far...

Well, I'm very happy that my style finally got so well. It's finished but the perfectionist in me can't let it go until the last visual glitches are fixed.

One glitch I'm sure that I can't let go happens on the arrow buttons that appears when there isn't enough room for the tabs. What happens is that those fracking arrow buttons erase a part of the tab panel. With the absolutely square button of the CDE style you can't see it but with the smooth rounded buttons of my style, it's... irritating. 4 pixels are obviously missing.

I managed to recognize these buttons amongst the jungle of things my style must handle. That enabled me to put arrows on them, even with the right colors. That's quite an exploit that forced me to dig deep in Qt/KDE sources to find what widget is actually used --FYI, it's a toolbutton.-- and with what flags. But that's not enough. I haven't found (yet) the way to know if theses buttons are on a top or bottom tab bar... and that's very anoying when you want to re-draw the tab panel of which the position depends on that very information. Right now, my style handles this issue only when the tabs are on top position but that also means a twice ugly glitch when the tabs are below the panel. (And I prefer not to think of the vertical tabs of Qt 4!) What I need is something that will fit with both top and bottom tabs. I'm still waiting for the enlightenment.

Oh yeah, I was saying "one step too far". I went just one step too far when I succeeded to prevent Kate from turning the button labels to red. This hack also prevented any app from changing the color of any button label. That was definitively too much. For example, KHTML needs this feature to have buttons with colors conform to what some HTML may tell it. Well, come on! Kate also goes too far. We don't need an icon plus a change of color on the pseudo tab to show us that a file has changed. The icon is enough. So, now my style recognizes Kate and prevents it (her?) only from messing with the colors.

I did this earlier before to eat, after I realized that re-installing Java wasn't enough to enable Konqueror to cope with this fracking Blogger site. For some reason, Java wasn't installed on my system any more. All the folders are still here but they are just empty and there is also a mess of broken links. The worst is that I don't even know who or what did this. That's not me. I didn't even realized it since Firefox doesn't complain about anything nor warned me that Java wasn't available any more. Welcome to the computer twilight zone, once again!

In the mean time, --while waiting for the enlightenment about these tab-related arrow buttons-- I took my now old Powder window decoration and I transformed it to match my style. I find the result rather interesting. The buttons look like just regular buttons with the same colors, except that you can choose the mouseover color for each button. --I kept this from Powder.-- The titlebar is like a checkbox --it's selected on the active window-- and the toggle buttons --maximize, sticky or keep above/below-- also behave like checkboxes. The frame around the window looks like a panel just thicker and more rounded. It gives a really consistant look to the windows.

Now, excuse me but I have to reduce some spaces on my windec, clean up the config dialogs of both the style and the windec... And it's already tomorrow!

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. ;-)