On Sat, 2009-03-14 at 13:04 -0700, Krzysztof KosiĆski wrote:
Finally, to follow the new "per-application" theme spec, all we need
to
do is locate the *dynamically* determined settings directory
(changes at
runtime due to the XDG directory spec), and add that directory to
the
list of sources searched for named icons.
We don't need to add any dynamically determined dirs anywhere. It's already done for us by GTK. It searches the current theme, regardless of whether it's in the user's ~/.icons directory, an XDG directory or in some system directory. This way if I choose a theme that has the "draw-rectangle" icon in the GNOME appearance properties dialog it is automatically used instead of our icon. This already works for e.g. the draw-eraser icon which I have in my theme.
Yes, actually last time I checked we *do* need to add a directory for the new stuff to work.
That's the whole point of the "Themable Application-specific Icons" http://live.gnome.org/ThemableAppSpecificIcons
In fact, here's a copy-n-paste from their "specification"
In your application, where you initialize GTK+, you also want to do the following, so that your application will find these icons if the theme tree structure in use, doesn't provide them:
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), APPNAME_DATA_DIR G_DIR_SEPARATOR_S "icons");
Now... the old way for applications was to hardcode their locations. Newer developments added support for the XDG directory specification. So we would want to use things like
g_get_system_data_dirs() and g_get_user_data_dir()
Then a user can change sets, themes being used, MRU, etc, just by launching with a different XDG environment variable set.