Actually gtk supports on the fly changes, so in theory that's possible (will likely require sugar fixes). I'm not too sure if that works well when an icon inside a theme changes rather than the whole theme though.
I suspect finding the best solution will involve reading gtk icon themes code here :) On Wednesday, 19 June 2013, Daniel Narvaez wrote: > If inotify is available it will use that I think. Checking time is an > option for the sugar cache (file content) but not for the gtk one (file > path). > > Perhaps it's fine if the change is picked up on activity restart? It will > probably not auto apply anyway, only newly created icons will change even > if the caches are invalidated. > > On Wednesday, 19 June 2013, Gonzalo Odiard wrote: > >> Hmm, that will be a file monitor for every activity running too, >> if I am not wrong, that is implemented polling, >> may be is better check datetime modification when one icon is needed. >> >> Gonzalo >> >> >> On Wed, Jun 19, 2013 at 12:05 PM, Daniel Narvaez <dwnarv...@gmail.com>wrote: >> >>> Oh yes, you will need to invalidate both caches. I guess the shell can >>> keep a file monitor on the icons dir and invalidate when it changes. >>> >>> >>> On Wednesday, 19 June 2013, Walter Bender wrote: >>> >>>> On Wed, Jun 19, 2013 at 10:53 AM, Daniel Narvaez <dwnarv...@gmail.com> >>>> wrote: >>>> > About the cache, did you try >>>> > >>>> > >>>> https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-theme-rescan-if-needed >>>> >>>> Tried that. Sugar seems to cache its icons separately from GTK. There >>>> used to be a cache file, but now I think it is all in memory. I need >>>> to dig deeper. >>>> >>>> -walter >>>> > >>>> > >>>> > On Wednesday, 19 June 2013, Walter Bender wrote: >>>> >> >>>> >> Here are some thoughts about the custom icon patch: >>>> >> >>>> >> (1) if we prepend ~/.sugar/icons to the theme icon path, then >>>> anything >>>> >> in that path will be used (as long as we flush the cache) as per >>>> >> dnarvaez's comment on the patch >>>> >> (2) if we have a sugar activity for selecting svg files (from the >>>> >> journal and some samples) and loading the selected file as >>>> >> computer-xo.svg into ~/.sugar/icons then we are done. >>>> >> >>>> >> #1 is a two-line addition to jarabe/main.py >>>> >> >>>> >> icons_path = os.path.join(os.path.expanduser('~'), '.sugar', >>>> 'icons') >>>> >> Gtk.IconTheme.get_default().prepend_search_path(icons_path) >>>> >> >>>> >> #2 is similar to what you already did for the cpsection, only it is a >>>> >> stand-alone activity similar to xo-colors >>>> >> >>>> >> We can use Turtle Art and other activities to generate SVGs. (The old >>>> >> version of xo-colors let you edit the XO icon... with revisiting in >>>> >> this context.) >>>> >> >>>> >> We need to figure out how to flush the icon cache. >>>> >> >>>> >> regards. >>>> >> >>>> >> -walter >>>> >> >>>> >> >>>> >> -- >>>> >> Walter Bender >>>> >> Sugar Labs >>>> >> http://www.sugarlabs.org >>>> > >>>> > >>>> > >>>> > -- >>>> > Daniel Narvaez >>>> > >>>> >>>> >>>> >>>> -- >>>> Walter Bender >>>> Sugar Labs >>>> http://www.sugarlabs.org >>>> >>> >>> >>> -- >>> Daniel Narvaez >>> >>> >>> _______________________________________________ >>> Sugar-devel mailing list >>> Sugar-devel@lists.sugarlabs.org >>> http://lists.sugarlabs.org/listinfo/sugar-devel >>> >>> >> > > -- > Daniel Narvaez > > -- Daniel Narvaez
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel