[PATCH] Undetachable KDockWidget's

Zack Rusin zack at kde.org
Tue Aug 5 22:22:17 BST 2003


How many developers does it take to screw a lightbulb? Not sure, but the  
detachable KDockWidget's simply don't work in Kontact. Good, I'm glad 
you're all with me on that one.
What's cool about KDockWidget's (besides that fact that their name 
starts with a K) is the fact that the widgets inside docks can be 
dragged around the main container so in applications like KNode users 
can select which widget is where. In KMail we have hard coded layout 
strategies with splitters, although they work, it would obviously make 
sense to simply let users layout them. In any way, the attached patch 
lets one create undetachable dock widgets. There's a small trick in the 
patch: the layout of the drag handle is QHBoxLayout (to fit the small 
buttons on it), with a Minimum resize mode, which in turn means that if 
no widget is visible inside of it, the drag handle dissapears. In order 
to make it show when none of the buttons is visible I'd had to consider 
two options: 1) implementing custom QHBoxLayout derivative with a new 
minimumSize implementation, 2) simply add a dummy widget with a minimal 
width and height equal to the other button. I've chosen the second 
method (which you knew already, because you're all smart enough to know 
that when a guy uses words like "simply", "nicely" or "neatly" in one 
of the options, he's trying to pitch that one to you ;) ).
Some of you may say: "Zack, you look really good today", which is really 
nice but remember, it's about the patch... Oh, and a screenshot showing 
the look of it in Kontact is here: 
http://www.automatix.de/~zack/knodekontact1.png . Comments?

Zack

-- 
To me, boxing is like a ballet, except there's no music, no 
choreography, and the dancers smack each other up side the head. 




More information about the kde-core-devel mailing list