more icon theme stuff (blah)
Brian J. Tarricone
bjt23 at cornell.edu
Sun Apr 18 11:54:30 CEST 2004
Jasper Huijsmans wrote:
> Brian J. Tarricone wrote:
>> ok... so now my icons are totally screwed up (or rather, they were,
>> until i hacked my system to pieces fixing it). i _really_ think all
>> icons need to be moved to $datadir/icons pronto. i also think all
>> our themes need to be prefixed with "Xfce-". things just aren't
>> working right with $datadir/xfce4/icons, and i can't seem to figure
>> out why.
>> it _seems_ obvious. i point at an icon, "gnome-settings", to act as
>> the icon for the "Settings" menu. it doesn't show up. i move aside
>> $datadir/xfce4/icons/gnome, and presto, it appears. i move our gnome
>> theme back, and it's gone again. but look! gnome-multimedia isn't.
>> and i have no idea why it shows up, when gnome-settings doesn't.
>> the gnome-settings problem seems to indicate that GtkIconTheme is
>> giving up if it finds a theme dir, but can't find an icon (regardless
>> if there is another identical theme directory farther down in the
>> search path). honestly, i think this is a gtk bug, but the bug i
>> filed on gnome bugzilla over 2 weeks(?) ago hasn't even been
>> commented upon. i really don't want to fork GtkIconTheme. i really
>> don't. i don't have the time or energy to maintain it, to say
>> nothing of familiarising myself with it.
>> so i say the hell with it, let's just move everything to
>> $datadir/icons. that seems to be the Right Thing to do anyway. the
>> cool thing is that, e.g., the "Xfce-Noia" theme can "inherit" from
>> "Noia", so it will pick up icons from the latter theme if they aren't
>> in ours.
>> the only downside (aside from the time and work required to do the
>> change) is that of handling fallback behaviour. if the user selects
>> a non-"Xfce-" theme, they may not have the files the panel requires.
>> the simple fix for that is to duplicate the icons from our default
>> ("Xfce-Curve") theme and dump them in $datadir/icons/hicolor. so
>> maybe we overwrite someone else's icons. tough. that's a packaging
>> the fix for this downside, however, has its own downside. that means
>> that no matter what non-"Xfce-" theme the user picks, they'll have to
>> live with "Xfce-Curve" icons for the panel. the panel _could_ have
>> an "icon theme override" option, but that sounds rather hackish. i
>> can't see any way around this.
> AFAIK, the way the icon theme spec was intended, applications install
> default icons in the hicolor theme. (Question: how does this work when
> installing in a different prefix? Should we install our own
> index.theme file?).
as for how the icon theme spec is written, you're supposed to look in
$XDG_DATA_DIRS/icons, which should default to $datadir/icons if it isn't
explicitly set. GtkIconTheme is a little bit sloppy there. it ignores
the XDG_DATA_DIRS env var, but it searches in $datadir/icons and
/usr/share/icons (regardless of prefix). this bothers me somewhat, but
i didn't get around to fixing this in time for gtk 2.4.0, so...
> Icon themes are installed to some known locations and can provide
> alternative icons. Idealy, I guess, icon themes are installed as one
> package. If we want to provide our own icons for existing icon themes
> we could try getting them into the official theme or make our theme
> package depend on the presence of the original theme.
getting stuff into the official theme takes time and effort, and i'm not
sure anyone really wants to do that =p. also, there are lots of
official themes out there, all with different authors. and, iirc, the
official themes aren't really all that consistent as to what they
contain (beyond a few common ones, i think).
> Using xfce-<name> themes inheriting from the original <name> theme
> would work but doesn't really feel right to me.
i know. it doesn't feel right to me either =(.
> On a related note, how does gnome make sure it's gnome theme is used
> as default fallback? Or doesn't it?
i dunno; i think olivier already answered this.
> Another thing I'm unsure about is the interaction between gtk themes
> and icon themes. Several gtk themes specify an icon theme; will our
> settings dialog always override this, or should we set the icon theme
> to 'None' and make sure the theme set by the gtkrc file is used? Would
> this work at all?
ugh, i forgot about that. totally and completely. right now it ignores
the gtk theme's icon theme preference, but it shouldn't be too painful
to add support for that. i think a simple policy is fine:
- by default, use whatever we've designated as the default icon theme
- if a gtk theme is selected which supplies and icon theme name, first
check to see if it exists (maybe checking first to see if an Xfce-$name
theme exists, if we go that route), and set it if it does. if not,
leave it as it is.
- if the user later selects a gtk theme that doesn't have an associated
icon theme, leave the icon theme setting as it was before the gtk theme
selection was made.
More information about the Xfce4-dev