From 37e32ec90771d7271f30cef3da5be749210e5d8c Mon Sep 17 00:00:00 2001 From: Paul Giblock Date: Thu, 29 Jan 2009 03:26:52 +0000 Subject: [PATCH] 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 --- data/themes/default/theme.xml | 13 +++++++++++++ src/core/main.cpp | 21 +++++++++++++++++---- src/gui/cusis_style.cpp | 1 - 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 data/themes/default/theme.xml diff --git a/data/themes/default/theme.xml b/data/themes/default/theme.xml new file mode 100644 index 000000000..bf716ed6f --- /dev/null +++ b/data/themes/default/theme.xml @@ -0,0 +1,13 @@ + + Classic 0.4 Theme + + Tobias Doerffel + Paul Giblock + + The LMMS-0.4 look and feel + + + + + + diff --git a/src/core/main.cpp b/src/core/main.cpp index 0a708ad7d..5eee1e1d3 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -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 diff --git a/src/gui/cusis_style.cpp b/src/gui/cusis_style.cpp index abc8641e7..37ac91564 100644 --- a/src/gui/cusis_style.cpp +++ b/src/gui/cusis_style.cpp @@ -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(); }