When do you use em for height/width on boxes? And why not use % instead?
Use this to demonstrate Adaptive, Responsive, Static and Liquid
11–13 of 13 posts
Re: Use this to demonstrate Adaptive, Responsive, Static and Liquid
#12I had this idea about using a "utility" function to represent how useful a given amount of screen space is to each widget, and then choosing the layout that maximizes the sum of the utility functions. It hasn't gained any traction, and I haven't had time to implement it myself. See http://gtk.10911.n7.nabble.com/Idea-for-automatic-widget-lay... for more details.
I quite like this idea. A lot of toolkits already allow a widget to specify a "preferred size." I wonder if a simpler approach to your idea would be similar to e.g. the Accept-Content-Type HTTP header; a widget lists a series of preferred widths (or width ranges) with weights.
preferred-width: 300px, 1.0; 200px..299px, 0.7; 100px..199px, 0.5;
That's slightly less flexible than a utility curve function, but (especially if ordered) is far easier to optimize for, as choices are ordered and restricted.Re: Use this to demonstrate Adaptive, Responsive, Static and Liquid
#13Thats kindda cool :D