Add theme-xml for choosing style classes and optional params for a theme
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1987 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
13
data/themes/default/theme.xml
Normal file
13
data/themes/default/theme.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<lmmsTheme>
|
||||
<title>Classic 0.4 Theme</title>
|
||||
<authors>
|
||||
<author>Tobias Doerffel</author>
|
||||
<author>Paul Giblock</author>
|
||||
</authors>
|
||||
<description>The LMMS-0.4 look and feel</description>
|
||||
<lmmsStyle class="ClassicStyle"> <!-- can be ClassicStyle or CusisStyle -->
|
||||
<!-- style-specific settings go here -->
|
||||
</lmmsStyle>
|
||||
<qStyle class="ClassicStyle"/> <!-- can be QPlastiqueStyle, ClassicStyle, CusisStyle QMotifStyle, etc.. -->
|
||||
<defaultBackground url="..."/>
|
||||
</lmmsTheme>
|
||||
@@ -60,8 +60,9 @@
|
||||
#include "song.h"
|
||||
#include "basic_ops.h"
|
||||
|
||||
// FIXME Make a factory class for this (or hide it behind engine)
|
||||
// TODO Make a factory class for this (or hide it behind engine)
|
||||
#include "lmms_style.h"
|
||||
#include "cusis_style.h"
|
||||
#include "classic_style.h"
|
||||
|
||||
#warning TODO: move somewhere else
|
||||
@@ -370,9 +371,21 @@ int main( int argc, char * * argv )
|
||||
{
|
||||
// init style and palette
|
||||
// TODO, select based on theme.xml!
|
||||
ClassicStyle * style = new ClassicStyle();
|
||||
QApplication::setStyle( style );
|
||||
engine::setLmmsStyle( style );
|
||||
bool useCusis = configManager::inst()->artworkDir().contains(
|
||||
"cusis", Qt::CaseInsensitive );
|
||||
|
||||
if( useCusis ) {
|
||||
CusisStyle * style = new CusisStyle();
|
||||
QApplication::setStyle( style );
|
||||
engine::setLmmsStyle( style );
|
||||
}
|
||||
else {
|
||||
ClassicStyle * style = new ClassicStyle();
|
||||
QApplication::setStyle( style );
|
||||
engine::setLmmsStyle( style );
|
||||
}
|
||||
|
||||
// END TODO
|
||||
|
||||
// init splash screen - this is a bit difficult as we have a
|
||||
// semi-transparent splash-image therefore we first need to grab
|
||||
|
||||
@@ -786,7 +786,6 @@ void CusisStyle::drawTrackContentBackground( QPainter * _painter, const QSize &
|
||||
_painter->drawLine( QLine( x, 0, x, h ) );
|
||||
}
|
||||
_painter->drawLine( 0, h - 1, w * 2, h - 1 );
|
||||
_painter->end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user