Some gtk-style-context feedback



Hey Carlos,

after playing around with gtk-style-context some more (not as much as
I'd like to...), some notes:

I think the property registration using default values stored in
GValue is really cumbersome:

  GdkColor white = { 0xffff, 0xffff, 0xffff };

  g_value_init (&color_value, GDK_TYPE_COLOR);
  g_value_set_boxed (&color_value, &white);
  gtk_theming_engine_register_property ((GtkThemingEngine *)engine,
                                        "focus-color", GDK_TYPE_COLOR,
                                        (const GValue *)&color_value, NULL);

Having to do that for a long set of properties is not nice. I think it
would be good to reuse the existing GParamSpec machinery for this,
which already handled default values, among other things.

We could just copy what GtkSettings does, and have

void
gtk_theming_engine_register_property (GParamSpec              *pspec,

GtkStylePropertyParser  parser);

Also, it seems that GtkStyleSet currently stores these properties in a
static array, and never removes them.
That is probably going to lead to problems if a theming engine is ever
unloaded and reloaded, since it is going to register those properties
again. Perhaps we need a gtk_themeing_engine_unregister_property () to
call in the theming engine finalize ?


Matthias


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