diff options
author | Robert Jonsson <spamatica@gmail.com> | 2013-03-02 23:48:54 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2013-03-02 23:48:54 +0000 |
commit | 8c3f10f97d58e596a2ecd1c5c2280d2b6b7f5e11 (patch) | |
tree | 3af366d6b57bbdf85c6d51533bca890a60f54518 /muse2/muse | |
parent | 887f6426bd58f1bfd2bc38d1a2b57f1f4be5edbc (diff) |
added ardour theme
Diffstat (limited to 'muse2/muse')
-rw-r--r-- | muse2/muse/appearance.cpp | 63 | ||||
-rw-r--r-- | muse2/muse/widgets/appearancebase.ui | 10 |
2 files changed, 39 insertions, 34 deletions
diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index 2b696c7b..057e12de 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -241,12 +241,11 @@ Appearance::Appearance(Arranger* a, QWidget* parent) connect(hval, SIGNAL(valueChanged(int)), SLOT(hsliderChanged(int))); connect(sval, SIGNAL(valueChanged(int)), SLOT(ssliderChanged(int))); connect(vval, SIGNAL(valueChanged(int)), SLOT(vsliderChanged(int))); - connect(changeThemeButton, SIGNAL(clicked()), SLOT(changeTheme())); connect(addToPalette, SIGNAL(clicked()), SLOT(addToPaletteClicked())); //--------------------------------------------------- - // STYLE + // STYLE //--------------------------------------------------- openStyleSheet->setIcon(*openIcon); connect(openStyleSheet, SIGNAL(clicked()), SLOT(browseStyleSheet())); @@ -254,7 +253,21 @@ Appearance::Appearance(Arranger* a, QWidget* parent) connect(defaultStyleSheet, SIGNAL(clicked()), SLOT(setDefaultStyleSheet())); //--------------------------------------------------- - // Fonts + // THEMES + //--------------------------------------------------- + connect(changeThemeButton, SIGNAL(clicked()), SLOT(changeTheme())); + + QDir themeDir(MusEGlobal::museGlobalShare + QString("/themes")); + QStringList list; + + QStringList fileTypes; + fileTypes.append("*.cfg"); + list = themeDir.entryList(fileTypes); + + colorSchemeComboBox->addItems(list); + + //--------------------------------------------------- + // Fonts //--------------------------------------------------- fontBrowse0->setIcon(QIcon(*openIcon)); @@ -279,6 +292,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent) connect(removeBgButton, SIGNAL(clicked()), SLOT(removeBackground())); connect(clearBgButton, SIGNAL(clicked()), SLOT(clearBackground())); connect(partShowevents, SIGNAL(toggled(bool)), eventButtonGroup, SLOT(setEnabled(bool))); + //updateColor(); } @@ -469,12 +483,13 @@ void Appearance::updateFonts() //--------------------------------------------------------- // changeTheme // -// Simple theme selector that over time should -// be exchanged for a more dynamic solution //--------------------------------------------------------- void Appearance::changeTheme() { + if (colorSchemeComboBox->currentIndex() == 0) { + return; + } if(QMessageBox::question(MusEGlobal::muse, QString("Muse"), tr("Do you really want to reset colors to theme default?"), tr("&Ok"), tr("&Cancel"), QString::null, 0, 1 ) == 1) @@ -482,29 +497,29 @@ void Appearance::changeTheme() return; } - if (colorSchemeComboBox->currentIndex()==1) // light theme + + QString currentTheme = colorSchemeComboBox->currentText(); + printf("Changing to theme %s\n", currentTheme.toLatin1().constData() ); + + QString themeDir = MusEGlobal::museGlobalShare + "/themes/"; + backgroundTree->reset(); + if (QFile::exists(themeDir + QFileInfo(currentTheme).baseName()+ ".qss")) { - // load standard light theme - backgroundTree->reset(); - styleSheetPath->setText(""); - MusEGlobal::muse->loadStyleSheetFile(""); - MusEGlobal::config.styleSheetFile = ""; - QString configPath = MusEGlobal::museGlobalShare +"/lightbase.cfg"; - MusECore::readConfiguration(configPath.toLatin1().constData()); - colorSchemeComboBox->setCurrentIndex(0); - MusEGlobal::muse->changeConfig(true); + styleSheetPath->setText(themeDir + QFileInfo(currentTheme).baseName()+ ".qss"); + MusEGlobal::config.styleSheetFile = styleSheetPath->text(); } - else if (colorSchemeComboBox->currentIndex()==2) // dark theme + else { - // load standard dark theme - backgroundTree->reset(); - styleSheetPath->setText(MusEGlobal::museGlobalShare +"/darkbase.qss"); - MusEGlobal::config.styleSheetFile = styleSheetPath->text(); - QString configPath = MusEGlobal::museGlobalShare +"/darkbase.cfg"; - MusECore::readConfiguration(configPath.toLatin1().constData()); - colorSchemeComboBox->setCurrentIndex(0); - MusEGlobal::muse->changeConfig(true); + styleSheetPath->setText("arg"); + MusEGlobal::muse->loadStyleSheetFile(""); + MusEGlobal::config.styleSheetFile = ""; } + + QString configPath = themeDir + currentTheme; + MusECore::readConfiguration(configPath.toLatin1().constData()); + colorSchemeComboBox->setCurrentIndex(0); + MusEGlobal::muse->changeConfig(true); + close(); } //--------------------------------------------------------- diff --git a/muse2/muse/widgets/appearancebase.ui b/muse2/muse/widgets/appearancebase.ui index 0468cef7..cbb33fb4 100644 --- a/muse2/muse/widgets/appearancebase.ui +++ b/muse2/muse/widgets/appearancebase.ui @@ -1205,16 +1205,6 @@ <string>current settings</string> </property> </item> - <item> - <property name="text"> - <string>light theme (changing overrides all other settings)</string> - </property> - </item> - <item> - <property name="text"> - <string>dark theme (changing overrides all other settings)</string> - </property> - </item> </widget> </item> <item> |