Tue 13 Dec 2005

  • colors: The GTK+ team closed #114355 recently. This is pretty good stuff, as it lets us set the colors of themes independent of the theme itself. It’s been needed for a really long time, and they did a good job of it. Some details:

    (expressions): Whenever you need to specify a color in a GTK+ RC file, you can use an expression. Currently we have:

    mix (factor, color1, color2) shade (factor, color) lighter (color) darker (color)

    Lighter and darker are just shorthand for shade with factors of 1.3 and 0.7. You can also combine these, eg:

    bg[NORMAL] = mix (0.6, “Red”, shade (0.5, #1013ff))

    (symbolic): In a style, you can declare symbolic colors. For example:

    color["link-color"] = “Red”

    The symbolic colors can be used in color expressions as ‘@link-color’, and they are inherited along the style hierarchy.

    (System definition): We added an XSetting to let the desktop define specific symbolic colors, so that we can override the theme. We will also tie it to a GConf key as well. This can be done by property dialogs, or applets, or whatever is needed.

    The XSetting is called “Gtk/ColorScheme”. There is a patch in bugzilla to make gnome-settings-daemon map that to the GConf key /desktop/gnome/interface/gtk_color_scheme.

    There is also a gtk_style_lookup_color() call to get the symbolic color.

  • colors (remaining): There are a few things left to be done.

    1. We don’t have a list of symbols defined yet. We’re planning on doing this prior to GTK+ 2.10 being released.

    2. We don’t have any property dialogs written. They’re planned, but not implemented yet. It’s really easy to hook up a color button to the properties, a little bit harder to do a nice job.

    3. We need a way for rc files to define defaults for symbolic colors. Also, it would be nice to define a default color scheme in the metatheme file.