Re: chubbiness reduction



"Daniel Richard G." <straker@fox.mit.edu> writes:

> > > but use 1,1 for the scrollbar, etc. Not being able to override these on a
> > > widget-by-widget basis (by having {x,y}thickness as fields in
> > > GtkWidgetClass, for example) is making the final look much less successful
> > > than it could have been. 
> > 
> > Fixed in GTK 2.0 already. xthickness/ythickness are now in the style
> > instance rather than the style class.
> 
> Okay, that's an improvement. But you can still only have one default style
> at any given time. I need to have the theme_init() code specify (basically) 
> e.g. "all Gtk{H,V}Scrollbar widgets should have thickness 1,1, all GtkFrame
> widgets should have thickness 2,2, and everything else 3,3," etc.  It would
> need to specify the style (and thus particular values for {x,y}thickness)
> for all future instances of a particular widget. From looking at the docs,
> you can only change the initial style of a widget if you surround the
> gtk_*_new() call with gtk_widget_push_style() and _pop_style(), inside
> application code. (Please correct me if this has changed too)
> 
> That's why I was theorizing having xthickness/ythickness in GtkWidgetClass,
> so that you could get some GtkFooClass in theme_init(), and set
> foo_class->parent_class.parent_class.parent_class.xthickness = my_x (or
> similar) however you want. No differently than if you were specifying a new
> default scrollbar width, or check indicator size, etc.

I wish I could just say RTFM. Unfortunately, there aren't really
any docs on this.

But, basically, the idea is that a theme has complete control
over the style that is assigned to each widget. (And can pick
different style classes, even), via the:

  void (*rc_style_to_style) (GtkStyle   *style, GtkRcStyle *rc_style);

Function in GtkThemeEngine structure.

Regards,
                                        Owen





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