1 Use a customisation structure similar to cascading stylesheets
3 Cascading customisations
4 each item has a list of class names
5 simple rules determine the styles based on the class names
8 scopes manage most things
9 contain a stylesheet like a CSS file, a set of definitions
10 list of labels that must be applied to activate this style
11 what to apply the style to
12 list of classes that must be applied to activate this style
13 in what case to apply the style
14 list of style overrides
16 to resolve the styles we need
17 the scope to apply the styles
18 what we're applying it to
19 type of object {song, verse etc}
20 what classes are active
21 e.g. song_tag_creation
26 default - program defaults
27 system - system styles, global to all users
29 user - user styles, specific to the user
31 profile - profile styles
33 playlist - specific styles for the playlist
53 [<apply here>] class: plain "[globalise]" <select and the properties are displayed in a separate tree>
55 <style tree modifications only>
56 (style references) [style drop down][add]
57 some_other_class [remove]
62 [ ] show modifications only
63 background (bold if modified)
64 name | <value> [revert button]
67 KwCssAbstractStyleState
69 template <typename T> KwCssStyleState : KwCssAbstractStyleState
75 template <typename T> KwCssStyle : KwCssAbstractStyle
82 operator KwCssStyleState
86 KwCssPropertyMap styles;
88 typedef QMap<QString, KwCssAbstractStyleProperty> KwCssPropertyMap;
91 KwCssStyleDefinition* findStyleDefinition(QString class);
92 KwCssPropertyMap* getStyles();
93 KwCssPropertyMap* recalculateStyles();
95 KwCssScope* parentScope;
96 QMap<QString,KwCssStyleDefinition*> styleDefinitions;
98 QSet<KwCssScope*> childScopes;
102 class AbstractStylePropertyState
105 class StylePropertyState
108 class AbstractStyleCustomisation
109 virtual applyToState(AbstractStylePropertyState*) = 0;
112 class StyleCustomisation
113 {clear, revert, override} type
116 // apply a customisation to a state
117 operator << (StylePropertyState*, StyleCustomisation*)
120 Map<String, StylePropertyState> states
123 Map<String, StyleCustomisation> properties