[Kde-games-devel] Theming suport

Martin Heni martin at heni-online.de
Thu Mar 15 07:22:45 CET 2007


I agree with most others here on the theming. Here a couple of my thoughts 
anyway:

1.  The theme stuff should become not too complicated. Few people would use 
theme mixing anyway and it will make things more complicated for programmers, 
users and artists.
 I dont think we should make a general theme "language" which all games need 
to use.   

2. I would leave the implementation of the theming up to the game. However, 
a general theming dialog which allows to show theme names, descriptions 
(including translations) and preview pictures might useful. However, the game 
basically just gets the theme name and handles the change then.

3. Themes are nice but I dont think themes are top priority now. We should get 
one good theme ready for all games for KDE4. I think the artists are a bit 
overworked anyway ;-). If we manage more that's fine of course.

4. Sometimes I am not sure whether XML is the solution to everything. In my 
opinion often a simple text file (like KConfig) is more easy to create, 
understand and maintain. XML is more useful if the data becomes more 
hierachical or needs to be exchanged between machines.  Theme files which are 
manually maintained are in my opinion harder to read if they are XML. But 
this is just my opinion and it is not a very strong one.

Kwin4 uses theming quite thouroughly now. You can have a look at the 
implementation and the theme file if you like. The theme file is 
grafix/default.rc and basically specifies for all grafix items (denoted by 
KConfig groups) their properties like SVG ids, positions and sizes. However 
the exact properties used depend on the sprite and here I noticed that the 
theme properties quite depends on what you actually do with your sprite.
This relates to the issue of  a general theme language in libkdegames which 
might be difficult to achive for all different games.
All items change their theme when their changeTheme() method is called by the 
theme manager. Although this is just a first shot it works quite well in 
kwin4 for resizing and complete theme changes (which I handle identically).









More information about the kde-games-devel mailing list