cat /dev/maxilys

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

2006-07-05

KDE: Tomorrow is today

It's been a while since last time. But --at least-- I don't come here to say nothing. So here are the last news: A new version of Serenity is on its way... again!

I did just two things to the window decoration. First, I added a new button style: toolbutton. In other words, the buttons remain flat and only the icons are visible until mouseover or activation. Then you got a button background. I don't really like it. It's too flat for my taste but I left it. Maybe somebody will like it.

Yeah, there's something I learned during this development: Once released, a style doesn't really belong to you only anymore but to the users too. If I worked only for me, half of the features wouldn't be available. That's would be easier... but where would be the fun?

Second, I changed the window frame to be no thicker than 1 pixel. I was thinking that 2 pixels were useful to really separate one window from another. I tested and it wasn't. I can live with just 1 pixel.

Now, the widget style. I was happy to satisfy my control obsession. I didn't noticed it but my style disabled a useful feature: the menu auto-closure --that is the possibility to close a menu in clicking on its menu entry once opened. That's silly but I never used this feature because I didn't know it existed. In the Atari world where I lived before, I was used to click outside of a menu to close it. That's what I kept on going. My experience with the "Dark Side" was too short for me to get bad habits. Any way, I reactivated this feature.

It wasn't easy to do because Serenity was fooling Qt to prevent it from drawing etched text --I just can't stand etched text.-- but my trick also deactivated the menu auto-closure. The solution was as easy as I said on KDE-Look: I had to prevent Qt from drawing any text by itself. To do so, I just copied QStyle::drawItem() from Qt sources and pasted it into Serenity::drawItem(), without forgetting to remove absolutely everything that was related to etched text. So Qt keeps on drawing text but with the settings I want. I could removed my trick --an invalid styleHint() returned value-- and the menu auto-closure was back. Now, I can almost feel sorry for all the time and hard work it took me to find this trick. ;-)

Next, I took care of the tabs. Somebody wanted flat tabs. Why not? I'm not obliged to use them. However, along the way, I found that I kinda prefer colorless tabs. And when I say colorless, I mean active tabs which don't use the highlight color. I did that and then absolutely flat tabs. It was a little too flat so I added gradients. And that's it, I got 5 available styles for the active tabs. A little image:

[Tabs version 1.0]


And I almost forgot to say that the tabs can now be centered. I find it disturbing but the tabs were the only thing that wasn't centered in Serenity. I added a little switch.

Next, I fixed the QToolButtons. Well, in fact, there was a problem only with the label. I thought that there was no mentionable difference in between KToolButton and QToolButton. I was wrong... and Serenity had a problem.

I thought that the button to burn in K3B should be more visible. I touched Serenity sources and... suddenly, there was a label above the icon. Ho! My mistake! :-)

I looked into Qt sources to see what it was doing. I re-wrote it my way and better. Yes, I dare to say better because Serenity makes QToolButton respect the reverse layout when needed. To make KDE respect the reverse layout with its KToolButton, I had to patch it. I don't use any Right-To-Left script but I made extensive tests so that Serenity copes with them and I stumbled more than once on the limitations of Qt or KDE. Serenity always does better whenever possible.

Last thing for today: A new scrollbar style. It doesn't mimic the look of any existing GUI, it removes the arrow buttons. A few day ago, an old post from Max Howell re-appeared on Planet KDE. He proposed a patch to definitively remove the buttons arrows from one's KDE. IMHO, that was too extreme... but also the kind of thing a style could do.

Max was saying that the arrow buttons of the scrollbars were the less used buttons of KDE. I rather agreed with him. Apart when I played a lot with them while styling them, I just don't use them. Never. I use the mousewheel everywhere. So, let's remove these buttons!

With the help of Max's patch, it took me no time to implement this feature. It was telling me just what I had to take care of.

$ make
$ su
password:
# make install ; exit

That was it. Look at this image. This is a preview of the next version 1.0 of Serenity. Tomorrow is today... at least for me. ;-)

On the image, you can see centered tabs with the colorless look, the (new) non-solid separators, and the arrowless scrollbar sliders.

Well, "arrowless" is a bit of an exaggeration. Actually, there are tiny arrows on the tips of the slider to remind you what this strange looking widget is. The arrows aren't working, they are here just to make the slider look better. (I will probably melt them a little more with the background.) So you have a perfectly working scrollbar but without useless arrow buttons to shrink a slider that has not always enough room. And since this is a selectable feature, no problem for those who have no mousewheel (e.g. a laptop).

I can hardly wait to release Serenity 1.0! If things go as expected, this week-end should be the day...

1 Comments:

At 05 July, 2006 12:30, Anonymous Anonymous said...

I've not seen this theme before, but I think it looks smart, I'll have to try it.

I'm glad that my accidently reposting of that post bore fruit, heh :) Also I think it's very sensible to draw arrows on the ends so that people realise it's a scrollbar, and it looks smart to boot. Good work :)

 

Post a Comment

<< Home