From 8c3f10f97d58e596a2ecd1c5c2280d2b6b7f5e11 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Sat, 2 Mar 2013 23:48:54 +0000 Subject: added ardour theme --- muse2/ChangeLog | 2 ++ muse2/muse/appearance.cpp | 63 +++++++++++++++++++++-------------- muse2/muse/widgets/appearancebase.ui | 10 ------ muse2/share/CMakeLists.txt | 3 +- muse2/share/darkbase.cfg | 62 ---------------------------------- muse2/share/darkbase.qss | 53 ----------------------------- muse2/share/lightbase.cfg | 64 ------------------------------------ muse2/share/themes/Ardour.cfg | 62 ++++++++++++++++++++++++++++++++++ muse2/share/themes/Ardour.qss | 53 +++++++++++++++++++++++++++++ muse2/share/themes/CMakeLists.txt | 30 +++++++++++++++++ muse2/share/themes/Dark Theme.cfg | 62 ++++++++++++++++++++++++++++++++++ muse2/share/themes/Dark Theme.qss | 53 +++++++++++++++++++++++++++++ muse2/share/themes/Light Theme.cfg | 64 ++++++++++++++++++++++++++++++++++++ 13 files changed, 367 insertions(+), 214 deletions(-) delete mode 100644 muse2/share/darkbase.cfg delete mode 100644 muse2/share/darkbase.qss delete mode 100644 muse2/share/lightbase.cfg create mode 100644 muse2/share/themes/Ardour.cfg create mode 100644 muse2/share/themes/Ardour.qss create mode 100644 muse2/share/themes/CMakeLists.txt create mode 100644 muse2/share/themes/Dark Theme.cfg create mode 100644 muse2/share/themes/Dark Theme.qss create mode 100644 muse2/share/themes/Light Theme.cfg diff --git a/muse2/ChangeLog b/muse2/ChangeLog index d6b03f1a..528a6350 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,5 @@ +03.02.2013: + - Generalized theming somewhat more and added a basic Ardour complementary theme (rj) 28.02.2013: - Wave Editor: Fixed some painting problems. Optimizations, speed boosts. (Tim) 24.02.2013: 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 @@ current settings - - - light theme (changing overrides all other settings) - - - - - dark theme (changing overrides all other settings) - - diff --git a/muse2/share/CMakeLists.txt b/muse2/share/CMakeLists.txt index 26e011f6..ba75f398 100644 --- a/muse2/share/CMakeLists.txt +++ b/muse2/share/CMakeLists.txt @@ -33,6 +33,7 @@ subdirs( wallpapers scoreglyphs locale + themes ) -install (FILES didyouknow.txt splash.png darkbase.qss darkbase.cfg lightbase.cfg DESTINATION ${MusE_SHARE_DIR} ) +install (FILES didyouknow.txt splash.png DESTINATION ${MusE_SHARE_DIR} ) diff --git a/muse2/share/darkbase.cfg b/muse2/share/darkbase.cfg deleted file mode 100644 index 6ec8bcb5..00000000 --- a/muse2/share/darkbase.cfg +++ /dev/null @@ -1,62 +0,0 @@ - - - - Oxygen - 170 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/muse2/share/darkbase.qss b/muse2/share/darkbase.qss deleted file mode 100644 index 8c40a4ba..00000000 --- a/muse2/share/darkbase.qss +++ /dev/null @@ -1,53 +0,0 @@ -QWidget { - background-color: rgb(30,30,30); - color: rgb(120,120,120); -} - -QToolBar QToolButton { - background-color: rgb(50,50,50); - border-color: rgb(70,70,70); - border-style: outset; - border-width: 1px; - border-radius: 3px; - padding: 1px; - -} - -QAction { - background-color: rgb(150,150,150); - spacing: 3px; - padding: 1px 4px; - background: transparent; - border-radius: 4px; - } - -QMenu::item:selected { - background-color: rgb(40,90,40); -} - -QToolBar QToolButton:hover { - background-color: rgb(50,50,50); - border-color: rgb(58,167,221); - border-style: outset; - border-width: 1px; - border-radius: 3px; - padding: 2px; - -} - -QToolBar QToolButton:pressed { - background-color: rgb(30,30,30); - border-style: inset; - border-width: 1px; - border-radius: 2px; - padding: 2px; - -} -QToolBar QToolButton:checked { - background-color: rgb(30,30,30); - border-style: inset; - border-width: 1px; - border-radius: 2px; - padding: 2px; - -} diff --git a/muse2/share/lightbase.cfg b/muse2/share/lightbase.cfg deleted file mode 100644 index 9cced291..00000000 --- a/muse2/share/lightbase.cfg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - 170 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/muse2/share/themes/Ardour.cfg b/muse2/share/themes/Ardour.cfg new file mode 100644 index 00000000..a41bbb65 --- /dev/null +++ b/muse2/share/themes/Ardour.cfg @@ -0,0 +1,62 @@ + + + + Oxygen + 170 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/muse2/share/themes/Ardour.qss b/muse2/share/themes/Ardour.qss new file mode 100644 index 00000000..fa563e87 --- /dev/null +++ b/muse2/share/themes/Ardour.qss @@ -0,0 +1,53 @@ +QWidget { + background-color: rgb(108,109,121); + color: rgb(193,193,197); +} + +QToolBar QToolButton { + background-color: rgb(93,94,106); + border-color: rgb(70,70,70); + border-style: outset; + border-width: 1px; + border-radius: 5px; + padding: 1px; + +} + +QAction { + background-color: rgb(150,150,150); + spacing: 3px; + padding: 1px 4px; + background: transparent; + border-radius: 4px; + } + +QMenu::item:selected { + background-color: rgb(40,90,40); +} + +QToolBar QToolButton:hover { + background-color: rgb(50,50,50); + border-color: rgb(58,167,221); + border-style: outset; + border-width: 1px; + border-radius: 3px; + padding: 2px; + +} + +QToolBar QToolButton:pressed { + background-color: rgb(125,247,131); + border-style: inset; + border-width: 1px; + border-radius: 2px; + padding: 2px; + +} +QToolBar QToolButton:checked { + background-color: rgb(125,247,131); + border-style: inset; + border-width: 1px; + border-radius: 2px; + padding: 2px; + +} diff --git a/muse2/share/themes/CMakeLists.txt b/muse2/share/themes/CMakeLists.txt new file mode 100644 index 00000000..b31ddaec --- /dev/null +++ b/muse2/share/themes/CMakeLists.txt @@ -0,0 +1,30 @@ +#============================================================================= +# MusE +# Linux Music Editor +# $Id:$ +# +# Copyright (C) 1999-2013 by Werner Schweer and others +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +#============================================================================= + +file (GLOB theme_files *.cfg *.qss + ) + +install( FILES ${theme_files} + DESTINATION ${MusE_SHARE_DIR}/themes + ) + diff --git a/muse2/share/themes/Dark Theme.cfg b/muse2/share/themes/Dark Theme.cfg new file mode 100644 index 00000000..6ec8bcb5 --- /dev/null +++ b/muse2/share/themes/Dark Theme.cfg @@ -0,0 +1,62 @@ + + + + Oxygen + 170 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/muse2/share/themes/Dark Theme.qss b/muse2/share/themes/Dark Theme.qss new file mode 100644 index 00000000..8c40a4ba --- /dev/null +++ b/muse2/share/themes/Dark Theme.qss @@ -0,0 +1,53 @@ +QWidget { + background-color: rgb(30,30,30); + color: rgb(120,120,120); +} + +QToolBar QToolButton { + background-color: rgb(50,50,50); + border-color: rgb(70,70,70); + border-style: outset; + border-width: 1px; + border-radius: 3px; + padding: 1px; + +} + +QAction { + background-color: rgb(150,150,150); + spacing: 3px; + padding: 1px 4px; + background: transparent; + border-radius: 4px; + } + +QMenu::item:selected { + background-color: rgb(40,90,40); +} + +QToolBar QToolButton:hover { + background-color: rgb(50,50,50); + border-color: rgb(58,167,221); + border-style: outset; + border-width: 1px; + border-radius: 3px; + padding: 2px; + +} + +QToolBar QToolButton:pressed { + background-color: rgb(30,30,30); + border-style: inset; + border-width: 1px; + border-radius: 2px; + padding: 2px; + +} +QToolBar QToolButton:checked { + background-color: rgb(30,30,30); + border-style: inset; + border-width: 1px; + border-radius: 2px; + padding: 2px; + +} diff --git a/muse2/share/themes/Light Theme.cfg b/muse2/share/themes/Light Theme.cfg new file mode 100644 index 00000000..9cced291 --- /dev/null +++ b/muse2/share/themes/Light Theme.cfg @@ -0,0 +1,64 @@ + + + + + 170 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3