Andreas
Qt
KDE
Posted by Andreas
 in Qt, KDE
 on Friday, January 20, 2006 @ 20:26

There’s a lot of stuff going on in Development at Trolltech these days. So much that it’s really hard to keep your Importants and Urgents in order, trying hard not to lapse into brain hypothema(? all google hits for that word seem to be in Dutch), but at the same time we’re having so much fun with making Qt 4 better and better, that it’s hard to keep your hands off the keyboard! ;-) Whether it’s profiling and optimizing, creating new classes or polishing existing ones, there’s enough by far to keep any developer busy. And btw, we need more developers (and developesses, please!), so hint-hint, if you’re looking for a job… :-)

Wait up, wait up, back to the I’s and U’s. What’s Important is of course fixing critical bugs like crashes, serious usability issues and regressions. What’s Urgent is basically what has got to happen before some magic milestone X, like making stuff compile on Windows with MSVC .NET 2003 before we release 4.1.1. So you have to do your Important and Urgent stuff first. But then, there’s what you are passionate about. You know the feeling. When there’s something you just have to do, because it makes you feel great! And you typically get that feeling at 03:00am or when you just entered a 11-hour plane ride with no laptop around.

Anyway, today, passion has driven me to do more work on Plastique2. So Plastique is the default style on KDE for Qt apps that don’t know better, but it doesn’t quite deal with propagated backgrounds, like texture backgrounds and bases of a line edit. But now, with Plastique2, things are looking a whole lot better. Note that this is a jpeg, click on it to get the uncompressed png instead.

So what I’ve done is I’ve ditched the idea of “faking” alpha transparency, and gone the whole way through. So once finished, this will be the first true alpha blended Qt style, unless someone makes one before I’m done, of course. Some important points to notice here are:

  • The button contrast is improved, and the frame border color is now correct for all palette variants (no more black-black borders just because you chose a dark button color).
  • All sunken frames shade properly against the backdrop. Look at the inside of the line edits with the beauutiful brown texture base.
  • Radio buttons are drawn using QPainter::Antialiasing, which gives it a much smoother look than in Plastique.
  • You can set colors, gradients and brushes on any palette entry on any widget. The buttons on the left hand simply use a pink linear gradient or texture brush for the button’s QPalette::Button palette entry. Notice the shading on the button bevel. Expensive? Yes, very. ;-) But luckily it’s cached.
The code that generates a button used to be close to 180 lines of code. With Plastique2, it’s 130 lines, and looks better, I think, anyway. :-) In general, all of the controls are drawn using less code. The radio buttons, for instance, were 72 lines, and check boxes were 89 lines of code. In addition, Plastique2 has something like 200-300 lines of inlined sprites. Now check boxes are 55 lines, and radio buttons are 33 lines, no sprites ;-).

On the right, you can see an editable combobox with a white Base and green Button, and one with a texture Base and a gradient Button.

If you have any suggestions to what we could do to make Plastique2 rock even more, please let me know! And thanks again to Sandro Giessl who authored the original style, Plastik, from which Plastique has emerged. Any day of working on Plastique is a day of pleasure. ;-)

PS: Whether Plastique2 will replace Plastique (and be renamed Plastique) is not yet known, and even whether Plastique2 will be part of Qt 4 at all, has not yet been decided. So keeping our politics in order, all disclaimers posted, everything you have seen is subject to change. :-)

4 Responses to “Passion and Plastique2”

» Posted by Matt Newell
 on Friday, January 20, 2006 @ 22:16

I think that anti-aliasing the little triangle for combo boxes would look nice. Maybe even replace the triangle with ????, but i don’t have any ideas for that.

» Posted by Olaf Jan Schmidt
 on Saturday, January 21, 2006 @ 15:04

“The button contrast is improved, and the frame border color is now correct for all palette variants (no more black-black borders just because you chose a dark button color).”

Does this mean Plastique2 works perfectly with white-on-black or yellow-on-blue or low contrast colour schemes? If this is the case then _please_ make it a part of Qt!

For Qt3 and KDE3, not a single style was OK with black background, so I wrote my own (ugly looking) scheme (HighContrast), which is now part of KDE3.

It would be really great if I could retire it for KDE 4, or if we at least have one nicer looking alternative that works reasonably well with all colour schemes. I am convinced that the default KDE colour scheme must work with all possible colour schemes, but HighContrast is far too ugly to become the default.

Exotic colour schemes are needed by some partially sighted people (e.g. users with light allergy), so it is really important that we have a better long-term solution for this than my broken HighContrast style.

Another problem is that the option to easily change the colours and backggrounds of buttons might lead to a lot of hardcoded colours in applications, but we need to deal with via guidelines.

Olaf

(KDE Accessibility co-maintainer)

» Posted by adkilla
 on Monday, January 23, 2006 @ 06:30

How do I make the toolbar buttons smaller system wide? Qt 4.1 introduces large toolbar buttons, why?

Need to get back that precious screen real estate.

» Posted by Tim
 on Monday, January 23, 2006 @ 14:11

These are some very nice improvements to an already incredible widget style. Great work, thanks for the update! Here are some nice mockups of what I think a great kde4 qt style could look like:
http://achamayou.blogspot.com/



© 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners.