Make BB-tracks themeable

- This allows defining a default colour for BB-track patterns in the CSS
- The default colour is used for all bb-patterns which don't have a custom colour set by the user: in other words, the colour of a pattern can be any rgb-value OR "style colour"
- By default, all created bb-patterns use the style colour
- You can also reset colourized patterns to use style colour again
- Backwards compatibility: old projects will be loaded so that any pattern using either of the old default colours will be converted to use style colour

TODO: add a settings option that can disable custom colours (ie. always use style colour), and/or an option to reset all patterns in a project to style colour. This is needed, since themes can now change the song editor background, which can lead to unfortunate colour combinations with custom colours...
This commit is contained in:
Vesa
2014-06-06 11:06:12 +03:00
parent dba1e75a53
commit 910f89a5d3
4 changed files with 129 additions and 59 deletions

View File

@@ -683,18 +683,6 @@ void DataFile::upgrade()
}
// new default colour for B&B tracks
QDomNodeList list = elementsByTagName( "bbtco" );
for( int i = 0; !list.item( i ).isNull(); ++i )
{
QDomElement el = list.item( i ).toElement();
unsigned int rgb = el.attribute( "color" ).toUInt();
if( rgb == qRgb( 64, 128, 255 ) )
{
el.setAttribute( "color", bbTCO::defaultColor() );
}
}
// Time-signature
if ( !m_head.hasAttribute( "timesig_numerator" ) )
{