GNOME Bugzilla – Bug 125158
Remove styling attributes from the public API of all widgets
Last modified: 2004-12-22 21:47:04 UTC
I recently took a deeper look at the GTK+ API and came up with some "new" ideas where the API could be made somewhat cleaner and the overall application look and feel more consistent. Almost any application programmer needs to define some sane padding,margin,border,... parameters, when using boxes and other grouping widgets. In fact these settings do not reflect what is to be displayed, but HOW it's to be displayed. Analog example with an HTML document: Think of time before the invention of proper stylesheets where content was mixed with the design and color shemes. Indeed the theme/engine could be thought of like the CSS while the program is the HTML document. (somewhat simplified, but explains best where I see the design flaw in GTK+) Instead of having a function for setting the padding,spacing,handlewidth,... of a given widget there should be a STYLE parameter. e.g. Either a GtkBox is visible with padding _OR_ invisible and just used for placing a widget right/left/center aligned, the padding is set implicitely to 0 then. Currently the programmer programmer is requried to fill in sane integer values. The way how the thing looks depends on the theme the developer uses and either 3px, 5px,... or [n]px look best on the devs machine. A user with a quite thin theme with small fonts might find 10px padding disgusting, while the dev with 24" monitor and BIG fonts found it suitable. Solution: Get rid of almost ANY concrete spacing/padding/size settings in the API and leave the work of finding SANE values to the developers of theme engines occording to a specified style. Having several widgets for different contexts which are rendered and layouted slightly different depending on the used theme engine would fix that issue perfectly. There would be no need for a concrete padding/spacing value then and all GTK+ apps would have a consistent look and feel. I guess that's a API change for the some-day-to-come GTK+-3.0 release.
*** This bug has been marked as a duplicate of 101859 ***