Next: , Previous: Preferences support in custom files, Up: Customizing through XML and Python files


16.5.10 Creating themes

You can create your own themes and share them between users. You can then selectively chose which themes they want to activate through the preferences dialog (see GPS Themes).

Creating new themes is done in the customization files through the <theme> tag.

This tag accepts a number of attributes:

name (mandatory)
This is the name of the theme, as it will appear in the preferences dialog
description (optional)
This text should explain what the text does. It appears in the preferences dialog when the user selects that theme.
category (optional, default is General)
This is the name of the category in which the theme should be presented in the preferences dialog. Categories are currently only used to organize themes graphically. New categories are created automatically if you chose one that doesn't exist yet.

This tag accepts any other customization tag that can be put in the customization files. This includes setting preferences (<pref>, defining key bindings (<key), defining menus (<menu>), ...

If the same theme is defined in multiple locations (multiple times in the same customization file or in different files), their effects will be cumulated. The first definition of the theme seen by GPS will set the description and category for this theme.

All the children tags of the theme will be executed when the theme is activated through the preferences dialog. Although there is no strict ordering in which order the children will be executed, the global order is the same as for the customization files themselves: first the predefined themes of GPS, then the ones defined in customization files found through the GPS_CUSTOM_PATH directories, and finally the ones defined in files found in the user's own GPS directory.

     <?xml version="1.0" ?>
     <my-plug-in>
        <theme name="my theme" description="Create a new menu">
            <menu action="my action"><title>/Edit/My Theme Menu</title></menu>
        </theme>
     </my-plug-in>