GNOME Bugzilla – Bug 531070
adding themes from an xml file
Last modified: 2010-08-12 09:13:05 UTC
Would it be possible to implement new themes into gnumeric via xml files ? It could really ease and even allow a theme-database, kind of templates... Would be great !
There are several steps necessary to fulfill this goal: - devise a dtd or XMLSchema to describe the fi le structure. - replace map_area_series_solid_* by something which might be dynamically overriden. - implement theme loading.
Created attachment 115175 [details] What the default theme might look like as an xml file. Waiting for comments... Btw, may be the default theme should remain hardcoded.
I'm not sure that themes as xml files are a fantastic idea. What will happen if a file is created using a theme and then opened on a machine lacking the theme?
>> What will happen if a file is created using a theme and then opened >> on a machine lacking the theme? I guess we'll have to save the theme data in each file. Regarding the theme file itself, I'm not sure the current way we set object attributes is good. It would probably a good idea to have something similar to CSS (which could be expressed as xml). That would ease the writing of themes.
The issue I find with CSS is that it lacks the concept of a palette. Saving the theme with each file is not trivial either. We might end saving the theme whith each graph. Looks like all this needs more thinking.
Themes can be saved at the GODoc level. Just if we use CSS, we'll probably heve to use libcroco.
CSS is not appropriate in the end. If we had to use some existing syntax we should better use SVG styles. Anyway, a theme is merely a collection of styles, and we already have an XML syntax for styles, so I'll do it this way.
*** Bug 625880 has been marked as a duplicate of this bug. ***
Created attachment 167217 [details] [review] Preliminary patch Unfortunately, this does not fix everything. Known issues are (I might miss some at the moment): - themes would appear as plugins (but have no library, just an xml file) and can't be activated/dectivated properly; - used themes are not saved with the document, I'm not sure about what should be done, a local theme might have the same name than a saved theme, but be actually be different, which might lead to inconsistensies, and on the other side, if the theme is not saved, we will fall back to the default theme each time locally unknown theme is referenced in a file; - an xml theme is actually a collection of styles, but not every field in the styles will be taken into account (that would need more auto flags); - I need to write some documentation about how to build a new theme while I still remember how things work.
Created attachment 167376 [details] [review] Updated patch With this patch, themes don't appear as plugins.
Created attachment 167526 [details] [review] Hopefully final patch
I still need to add some documentation.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report. Fixed using a slightly modified patch, with some inline documentation.