Re: Style and Spacing (and Themes, but only in the end)




"Juergen A. Erhard" <jae@laden.ilk.de> writes:

> Obscure subject lines lead to the most important mails, didn't you
> know that?
> 
> Seriously: A while back, there was some discussion on how to make
> widget spacings uniform.  You know, the WIDTH in
> gtk_container_border_width(CONTAINER, WIDTH).
> 
> Now, I haven't seen anything on this in a while... has there been some
> decision or something?  Maybe in GNOME? (that's the reason for the
> crosspost)

There has been no particular decision in this regards. Mostly,
because no really nice solution has been proposed.

> It would be nice if one could begin to start handling this in such a
> way that it's easy later to implement.  Okay, maybe I just have to
> begin to replace all spacings with (hopefully) properly named
> constants.

Compiled in constants are not the right way to go here. 
Spacings need to be adjustable under user control, at run time.

Here's some ideas that come to mind.

 - Provide some conversion functions and macros:

  gtk_container_set_border_width (container, D(0.3,CM));
  gtk_widget_set_usize (widget, D(3,EM), -1);

where D(0.3,CM) gets converted to 
 
 gtk_dimension(0.3, GTK_CM);

or maybe directly to:

 (0.3 * gtk_dimensions[GTK_CM])

The problem is that D(3,EM) should be relative to 
style->font, and that may not be decided until after the border
width is set, and may be changed dynamically at run time.

 - Provide new variants for all functions taking dimensions
   (There were about 20 last fall, probably more now),
   that instead of an integer, take a float and a unit. (Or maybe
   a string)

   gtk_container_set_border_width_d (container, 0.3, GTK_CM);

   gtk_container_set_border_width_ds (container, "0.3 cm");

What units should be provided? Probably:

 GTK_PIXELS, GTK_IN, GTK_CM, GTK_PAD (a unit of spacing from the style)
 GTK_EM (The "em" of style->font). Maybe also a GTK_INVALID to
 cover the cases where -1 is currently used as a flag.

 - Make all dimensions signed and give special meanings to
   certain negative values:

   gtk_container_set_border_width (container, GTK_SMALL_PAD);

   This doesn't work if the dimension actually could be negative,
   or could inadvertantly become negative. It's not too flexible
   either, though that could be a good thing - since it would
   help ensure a consistent look and make it easier for the
   user to adjust.  

It is certainly something that needs to be addressed (I've felt
that way ever since all the space was compressed out of the
GIMP dialogs). If anybody has comments on the above ideas,
or ideas of their own, I'd appreciate hearing them.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]