After thinking about it for a bit I realized this was the second (or third?) time I have blogged about some idea I had, but never really tested out the theory. So this time I decided to try it out and see how it works. So here’s a prototype of the method I have been talking about the two last blogs. Picture on the left, and here’s a youtube video.
The way it works is that widgets are inserted, along with a priority, into an object that does it’s magic when a resize event is triggered. It loks at the difference between the widgets size and its minimumSizeHint, and if it’s approaching zero it hides the least important widget. It uses the same value to accumulate how much slack there is (total difference between minimumsizehint and size), and determines if it’s ok to show the most higly prioritized widget.
Although this code here is just a big hack, it would be interesting to compile it into some kde applications and see how it works (if it works at all).