After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 125158 - Remove styling attributes from the public API of all widgets
Remove styling attributes from the public API of all widgets
Status: RESOLVED DUPLICATE of bug 101859
Product: gtk+
Classification: Platform
Component: .General
2.2.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-10-21 20:46 UTC by Michael P. Jung
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Michael P. Jung 2003-10-21 20:46:03 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.
Comment 1 Owen Taylor 2003-10-21 20:50:58 UTC

*** This bug has been marked as a duplicate of 101859 ***