diff options
-rw-r--r-- | muse2/ChangeLog | 4 | ||||
-rw-r--r-- | muse2/muse/appearance.cpp | 90 | ||||
-rw-r--r-- | muse2/muse/appearance.h | 1 | ||||
-rw-r--r-- | muse2/muse/conf.cpp | 14 | ||||
-rw-r--r-- | muse2/muse/ctrl/ctrlcanvas.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/gconfig.cpp | 6 | ||||
-rw-r--r-- | muse2/muse/gconfig.h | 4 | ||||
-rw-r--r-- | muse2/muse/midiedit/dlist.cpp | 3 | ||||
-rw-r--r-- | muse2/muse/midiedit/ecanvas.cpp | 3 | ||||
-rw-r--r-- | muse2/muse/midiedit/prcanvas.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/widgets/CMakeLists.txt | 4 | ||||
-rw-r--r-- | muse2/muse/widgets/appearancebase.ui | 441 | ||||
-rw-r--r-- | muse2/muse/widgets/colorframe.cpp | 17 | ||||
-rw-r--r-- | muse2/muse/widgets/colorframe.h | 23 | ||||
-rw-r--r-- | muse2/muse/widgets/mtscale.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/widgets/mtscale_flo.cpp | 2 |
17 files changed, 360 insertions, 260 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 4b7acfba..83ad8da6 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,7 @@ +24.02.2013: + - Improved dark theme, midi editors now set background color, the current part of the ruler is darker. + Theme setting separated from the regular Ok button in the Appearance settings. Also fixed the color + viewer in the color selector when using the dark theme. (rj) 23.02.2013: - Added missing line draw shortcut (F) to drum editor. (Tim) 22.02.2013: diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index f148e752..2b696c7b 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -32,6 +32,7 @@ #include <QFileInfo> #include <QPainter> #include <QtGlobal> +#include <QMessageBox> #include "icons.h" #include "appearance.h" @@ -145,7 +146,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent) global_bg->setFlags(Qt::ItemIsEnabled); user_bg = new QTreeWidgetItem(backgroundTree, QStringList(tr("Custom")), 0); user_bg->setFlags(Qt::ItemIsEnabled); - colorframe->setAutoFillBackground(true); + colorwidget->setAutoFillBackground(true); aPalette = new QButtonGroup(aPaletteBox); aPalette->addButton(palette0, 0); @@ -179,6 +180,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent) new IdListViewItem(0x41c, aid, "part canvas background"); new IdListViewItem(0x41f, aid, "Ruler background"); new IdListViewItem(0x420, aid, "Ruler text"); + new IdListViewItem(0x424, aid, "Ruler current marker space"); id = new IdListViewItem(0, aid, "Track List"); new IdListViewItem(0x411, id, "background"); new IdListViewItem(0x412, id, "midi background"); @@ -199,7 +201,11 @@ Appearance::Appearance(Arranger* a, QWidget* parent) id = new IdListViewItem(0, itemList, "Transport"); new IdListViewItem(0x200, id, "handle"); id = new IdListViewItem(0, itemList, "Midi Editor"); - new IdListViewItem(0x41d, id, "controller graph"); + new IdListViewItem(0x41d, id, "controller graph color"); + new IdListViewItem(0x423, id, "controller graph background"); + new IdListViewItem(0x421, id, "background"); + new IdListViewItem(0x422, id, "drum list"); + id = new IdListViewItem(0, itemList, "Wave Editor"); new IdListViewItem(0x300, id, "background"); id = new IdListViewItem(0, itemList, "Mixer"); @@ -235,6 +241,7 @@ 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())); @@ -460,41 +467,52 @@ void Appearance::updateFonts() } //--------------------------------------------------------- -// apply +// changeTheme +// +// Simple theme selector that over time should +// be exchanged for a more dynamic solution //--------------------------------------------------------- -void Appearance::apply() - { - - // Changing color themes overrides all other configurations - - if (colorSchemeComboBox->currentIndex()==1) // light theme - { - // 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); +void Appearance::changeTheme() +{ + 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) + { return; + } + + if (colorSchemeComboBox->currentIndex()==1) // light theme + { + // 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); + } + else if (colorSchemeComboBox->currentIndex()==2) // dark theme + { + // 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); + } + close(); +} +//--------------------------------------------------------- +// apply +//--------------------------------------------------------- - } - else if (colorSchemeComboBox->currentIndex()==2) // dark theme +void Appearance::apply() { - // 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); - return; - } - // // int showPartEvent = 0; @@ -745,6 +763,10 @@ void Appearance::colorItemSelectionChanged() case 0x41f: color = &config->rulerBg; break; case 0x420: color = &config->rulerFg; break; + case 0x421: color = &config->midiCanvasBg; break; + case 0x422: color = &config->drumListBg; break; + case 0x423: color = &config->midiControllerViewBg; break; + case 0x424: color = &config->rulerCurrent; break; case 0x500: color = &config->mixerBg; break; case 0x501: color = &config->midiTrackLabelBg; break; @@ -790,8 +812,8 @@ void Appearance::updateColor() QPalette pal; QColor cfc(*color); - pal.setColor(colorframe->backgroundRole(), cfc); - colorframe->setPalette(pal); + colorwidget->setColor(cfc); + color->getRgb(&r, &g, &b); color->getHsv(&h, &s, &v); diff --git a/muse2/muse/appearance.h b/muse2/muse/appearance.h index 8b746cfd..f6023f22 100644 --- a/muse2/muse/appearance.h +++ b/muse2/muse/appearance.h @@ -61,6 +61,7 @@ class Appearance : public QDialog, public Ui::AppearanceDialogBase { private slots: void apply(); void ok(); + void changeTheme(); void cancel(); void addBackground(); void removeBackground(); diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 1f20d79b..535b6dbc 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -863,6 +863,16 @@ void readConfiguration(Xml& xml, bool doReadMidiPortConfig, bool doReadGlobalCon MusEGlobal::config.rulerBg = readColor(xml); else if (tag == "rulerForegroundColor") MusEGlobal::config.rulerFg = readColor(xml); + else if (tag == "rulerCurrentColor") { + MusEGlobal::config.rulerCurrent = readColor(xml); + printf ("Read ruler current color!!!!!\n"); + } + else if (tag == "midiCanvasBackgroundColor") + MusEGlobal::config.midiCanvasBg = readColor(xml); + else if (tag == "midiControllerViewBackgroundColor") + MusEGlobal::config.midiControllerViewBg = readColor(xml); + else if (tag == "drumListBackgroundColor") + MusEGlobal::config.drumListBg = readColor(xml); //else if (tag == "midiSyncInfo") // readConfigMidiSyncInfo(xml); @@ -1416,6 +1426,10 @@ void MusE::writeGlobalConfiguration(int level, MusECore::Xml& xml) const xml.colorTag(level, "waveEditBackgroundColor", MusEGlobal::config.waveEditBackgroundColor); xml.colorTag(level, "rulerBackgroundColor", MusEGlobal::config.rulerBg); xml.colorTag(level, "rulerForegroundColor", MusEGlobal::config.rulerFg); + xml.colorTag(level, "rulerCurrentColor", MusEGlobal::config.rulerCurrent); + xml.colorTag(level, "midiCanvasBackgroundColor", MusEGlobal::config.midiCanvasBg); + xml.colorTag(level, "midiControllerViewBackgroundColor", MusEGlobal::config.midiControllerViewBg); + xml.colorTag(level, "drumListBackgroundColor", MusEGlobal::config.drumListBg); MusEGlobal::writePluginGroupConfiguration(level, xml); diff --git a/muse2/muse/ctrl/ctrlcanvas.cpp b/muse2/muse/ctrl/ctrlcanvas.cpp index 1825d75d..d5adbc4f 100644 --- a/muse2/muse/ctrl/ctrlcanvas.cpp +++ b/muse2/muse/ctrl/ctrlcanvas.cpp @@ -188,7 +188,7 @@ void CEventList::clearDelete() CtrlCanvas::CtrlCanvas(MidiEditor* e, QWidget* parent, int xmag, const char* name, CtrlPanel* pnl) : View(parent, xmag, 1, name) { - setBg(Qt::white); + setBg(MusEGlobal::config.midiControllerViewBg); setFont(MusEGlobal::config.fonts[3]); editor = e; _panel = pnl; diff --git a/muse2/muse/gconfig.cpp b/muse2/muse/gconfig.cpp index 79bad91d..15938f1c 100644 --- a/muse2/muse/gconfig.cpp +++ b/muse2/muse/gconfig.cpp @@ -125,8 +125,12 @@ GlobalConfigValues config = { QColor(255, 170, 0), // ctrlGraphFg; Medium orange QColor(0, 0, 0), // mixerBg; - QColor(0xe0, 0xe0, 0xe0), // Ruler background + QColor(0xe0, 0xe0, 0xe0), // Ruler background QColor(0, 0, 0), // Ruler text + QColor(255, 255, 255), // Midi editor canvas + QColor(255, 255, 255), // midiControllerViewBg + QColor(255, 255, 255), // drumListBg + QColor(255, 255, 255), // rulerCurrent 384, // division; 1024, // rtcTicks diff --git a/muse2/muse/gconfig.h b/muse2/muse/gconfig.h index 44e982ab..93052427 100644 --- a/muse2/muse/gconfig.h +++ b/muse2/muse/gconfig.h @@ -136,6 +136,10 @@ struct GlobalConfigValues { QColor rulerBg; QColor rulerFg; + QColor midiCanvasBg; + QColor midiControllerViewBg; + QColor drumListBg; + QColor rulerCurrent; int division; int rtcTicks; diff --git a/muse2/muse/midiedit/dlist.cpp b/muse2/muse/midiedit/dlist.cpp index 58345ba9..09b33735 100644 --- a/muse2/muse/midiedit/dlist.cpp +++ b/muse2/muse/midiedit/dlist.cpp @@ -31,6 +31,7 @@ #include "globals.h" #include "globaldefs.h" +#include "gconfig.h" #include "app.h" #include "audio.h" #include "pitchedit.h" @@ -1202,7 +1203,7 @@ void DList::songChanged(MusECore::SongChangedFlags_t flags) void DList::init(QHeaderView* h, QWidget* parent) { - setBg(Qt::white); + setBg(MusEGlobal::config.drumListBg); if (!h) h = new QHeaderView(Qt::Horizontal, parent); diff --git a/muse2/muse/midiedit/ecanvas.cpp b/muse2/muse/midiedit/ecanvas.cpp index d2456283..492727cb 100644 --- a/muse2/muse/midiedit/ecanvas.cpp +++ b/muse2/muse/midiedit/ecanvas.cpp @@ -44,6 +44,7 @@ #include "audio.h" #include "functions.h" #include "midi.h" +#include "gconfig.h" namespace MusEGui { @@ -67,7 +68,7 @@ EventCanvas::EventCanvas(MidiEditor* pr, QWidget* parent, int sx, playedPitchPort = -1; playedVelocity = 0; - setBg(Qt::white); + setBg(MusEGlobal::config.midiCanvasBg); setAcceptDrops(true); setFocusPolicy(Qt::StrongFocus); setMouseTracking(true); diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp index 83c20a1a..92ed3758 100644 --- a/muse2/muse/midiedit/prcanvas.cpp +++ b/muse2/muse/midiedit/prcanvas.cpp @@ -736,7 +736,7 @@ void PianoCanvas::drawCanvas(QPainter& p, const QRect& rect) p.drawLine(x, yy, x + w, yy); break; default: - p.fillRect(x, yy-3, w, 6, QBrush(QColor(230,230,230))); + p.fillRect(x, yy-3, w, 6, MusEGlobal::config.midiCanvasBg.darker(110)); break; } --key; diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 3e4fd5c8..543e86aa 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -1271,7 +1271,7 @@ ScoreCanvas::ScoreCanvas(ScoreEdit* pr, QWidget* parent_widget) : View(parent_wi { parent = pr; setFocusPolicy(Qt::StrongFocus); - setBg(Qt::white); + setBg(MusEGlobal::config.midiCanvasBg); setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt index 8c407525..a4db13af 100644 --- a/muse2/muse/widgets/CMakeLists.txt +++ b/muse2/muse/widgets/CMakeLists.txt @@ -36,7 +36,8 @@ QT4_WRAP_CPP (widget_mocs action.h bigtime.h canvas.h - checkbox.h + checkbox.h + colorframe.h comboQuant.h combobox.h comment.h @@ -158,6 +159,7 @@ file (GLOB widgets_source_files canvas.cpp checkbox.cpp citem.cpp + colorframe.cpp comboQuant.cpp combobox.cpp comment.cpp diff --git a/muse2/muse/widgets/appearancebase.ui b/muse2/muse/widgets/appearancebase.ui index b82ff182..0468cef7 100644 --- a/muse2/muse/widgets/appearancebase.ui +++ b/muse2/muse/widgets/appearancebase.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>558</width> - <height>531</height> + <width>519</width> + <height>517</height> </rect> </property> <property name="windowTitle"> @@ -23,7 +23,7 @@ </sizepolicy> </property> <property name="currentIndex"> - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="tab1"> <attribute name="title"> @@ -776,19 +776,13 @@ <item row="0" column="2"> <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QFrame" name="colorframe"> + <widget class="ColorFrame" name="colorwidget" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> </widget> </item> <item> @@ -1084,15 +1078,9 @@ </sizepolicy> </property> <property name="title"> - <string>QT Theme</string> + <string>Themes</string> </property> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <layout class="QHBoxLayout"> <item> @@ -1209,23 +1197,34 @@ </widget> </item> <item> - <widget class="QComboBox" name="colorSchemeComboBox"> - <item> - <property name="text"> - <string>current settings</string> - </property> - </item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> - <property name="text"> - <string>light theme (changing overrides all other settings)</string> - </property> + <widget class="QComboBox" name="colorSchemeComboBox"> + <item> + <property name="text"> + <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> - <property name="text"> - <string>dark theme (changing overrides all other settings)</string> - </property> + <widget class="QPushButton" name="changeThemeButton"> + <property name="text"> + <string>Change</string> + </property> + </widget> </item> - </widget> + </layout> </item> <item> <spacer name="spacer3"> @@ -1258,33 +1257,47 @@ <property name="spacing"> <number>6</number> </property> - <item row="0" column="1"> - <widget class="QLabel" name="textLabel2"> + <item row="2" column="4"> + <widget class="QCheckBox" name="italic1"> <property name="text"> - <string>Family</string> + <string>Italic</string> </property> - <property name="wordWrap"> - <bool>false</bool> + </widget> + </item> + <item row="6" column="4"> + <widget class="QCheckBox" name="italic5"> + <property name="text"> + <string>Italic</string> </property> </widget> </item> - <item row="0" column="2"> - <widget class="QLabel" name="TextLabel1_1"> + <item row="4" column="4"> + <widget class="QCheckBox" name="italic3"> <property name="text"> - <string>Size</string> + <string>Italic</string> </property> - <property name="wordWrap"> - <bool>false</bool> + </widget> + </item> + <item row="7" column="1"> + <widget class="QLineEdit" name="fontName6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="textLabel4"> - <property name="text"> - <string>Font 1</string> + <item row="3" column="5"> + <widget class="QToolButton" name="fontBrowse2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="wordWrap"> - <bool>false</bool> + <property name="text"> + <string>...</string> </property> </widget> </item> @@ -1298,28 +1311,28 @@ </property> </widget> </item> - <item row="4" column="0"> - <widget class="QLabel" name="textLabel6"> + <item row="0" column="1"> + <widget class="QLabel" name="textLabel2"> <property name="text"> - <string>Font 3</string> + <string>Family</string> </property> <property name="wordWrap"> <bool>false</bool> </property> </widget> </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="fontName0"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="6" column="0"> + <widget class="QLabel" name="textLabel7_2"> + <property name="text"> + <string>Font 5</string> + </property> + <property name="wordWrap"> + <bool>false</bool> </property> </widget> </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="fontName1"> + <item row="4" column="1"> + <widget class="QLineEdit" name="fontName3"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -1328,216 +1341,205 @@ </property> </widget> </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="fontName2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="2" column="3"> + <widget class="QCheckBox" name="bold1"> + <property name="text"> + <string>Bold</string> </property> </widget> </item> - <item row="4" column="1"> - <widget class="QLineEdit" name="fontName3"> + <item row="7" column="4"> + <widget class="QCheckBox" name="italic6"> + <property name="text"> + <string>Italic</string> + </property> + </widget> + </item> + <item row="6" column="5"> + <widget class="QToolButton" name="fontBrowse5"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>...</string> + </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="textLabel3"> + <item row="4" column="0"> + <widget class="QLabel" name="textLabel6"> <property name="text"> - <string>Font 0</string> + <string>Font 3</string> </property> <property name="wordWrap"> <bool>false</bool> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QSpinBox" name="fontSize0"> + <item row="6" column="1"> + <widget class="QLineEdit" name="fontName5"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> </item> - <item row="2" column="2"> - <widget class="QSpinBox" name="fontSize1"> + <item row="1" column="1"> + <widget class="QLineEdit" name="fontName0"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> </item> - <item row="3" column="2"> - <widget class="QSpinBox" name="fontSize2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="3" column="3"> + <widget class="QCheckBox" name="bold2"> + <property name="text"> + <string>Bold</string> </property> </widget> </item> - <item row="4" column="2"> - <widget class="QSpinBox" name="fontSize3"> + <item row="5" column="5"> + <widget class="QToolButton" name="fontBrowse4"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QCheckBox" name="bold1"> - <property name="text"> - <string>Bold</string> - </property> - </widget> - </item> - <item row="3" column="3"> - <widget class="QCheckBox" name="bold2"> <property name="text"> - <string>Bold</string> + <string>...</string> </property> </widget> </item> - <item row="4" column="3"> - <widget class="QCheckBox" name="bold3"> - <property name="text"> - <string>Bold</string> + <item row="2" column="1"> + <widget class="QLineEdit" name="fontName1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> </widget> </item> - <item row="1" column="3"> - <widget class="QCheckBox" name="bold0"> - <property name="text"> - <string>Bold</string> + <item row="2" column="5"> + <widget class="QToolButton" name="fontBrowse1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </widget> - </item> - <item row="3" column="4"> - <widget class="QCheckBox" name="italic2"> <property name="text"> - <string>Italic</string> + <string>...</string> </property> </widget> </item> - <item row="4" column="4"> - <widget class="QCheckBox" name="italic3"> + <item row="1" column="0"> + <widget class="QLabel" name="textLabel3"> <property name="text"> - <string>Italic</string> + <string>Font 0</string> </property> - </widget> - </item> - <item row="2" column="4"> - <widget class="QCheckBox" name="italic1"> - <property name="text"> - <string>Italic</string> + <property name="wordWrap"> + <bool>false</bool> </property> </widget> </item> - <item row="1" column="4"> - <widget class="QCheckBox" name="italic0"> - <property name="text"> - <string>Italic</string> + <item row="2" column="2"> + <widget class="QSpinBox" name="fontSize1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> </widget> </item> - <item row="1" column="5"> - <widget class="QToolButton" name="fontBrowse0"> + <item row="1" column="2"> + <widget class="QSpinBox" name="fontSize0"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>...</string> - </property> </widget> </item> - <item row="2" column="5"> - <widget class="QToolButton" name="fontBrowse1"> + <item row="3" column="1"> + <widget class="QLineEdit" name="fontName2"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>...</string> - </property> </widget> </item> - <item row="3" column="5"> - <widget class="QToolButton" name="fontBrowse2"> + <item row="7" column="2"> + <widget class="QSpinBox" name="fontSize6"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + </widget> + </item> + <item row="5" column="3"> + <widget class="QCheckBox" name="bold4"> <property name="text"> - <string>...</string> + <string>Bold</string> </property> </widget> </item> - <item row="4" column="5"> - <widget class="QToolButton" name="fontBrowse3"> + <item row="5" column="2"> + <widget class="QSpinBox" name="fontSize4"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>...</string> - </property> </widget> </item> - <item row="5" column="0"> - <widget class="QLabel" name="textLabel7"> + <item row="2" column="0"> + <widget class="QLabel" name="textLabel4"> <property name="text"> - <string>Font 4</string> + <string>Font 1</string> </property> <property name="wordWrap"> <bool>false</bool> </property> </widget> </item> - <item row="5" column="1"> - <widget class="QLineEdit" name="fontName4"> + <item row="4" column="2"> + <widget class="QSpinBox" name="fontSize3"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget> </item> - <item row="6" column="0"> - <widget class="QLabel" name="textLabel7_2"> - <property name="text"> - <string>Font 5</string> - </property> - <property name="wordWrap"> - <bool>false</bool> + <item row="6" column="2"> + <widget class="QSpinBox" name="fontSize5"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> </widget> </item> - <item row="6" column="1"> - <widget class="QLineEdit" name="fontName5"> + <item row="5" column="1"> + <widget class="QLineEdit" name="fontName4"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -1556,24 +1558,37 @@ </property> </widget> </item> - <item row="7" column="1"> - <widget class="QLineEdit" name="fontName6"> + <item row="6" column="3"> + <widget class="QCheckBox" name="bold5"> + <property name="text"> + <string>Bold</string> + </property> + </widget> + </item> + <item row="1" column="5"> + <widget class="QToolButton" name="fontBrowse0"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>...</string> + </property> </widget> </item> - <item row="7" column="2"> - <widget class="QSpinBox" name="fontSize6"> + <item row="7" column="5"> + <widget class="QToolButton" name="fontBrowse6"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>...</string> + </property> </widget> </item> <item row="7" column="3"> @@ -1583,97 +1598,81 @@ </property> </widget> </item> - <item row="7" column="4"> - <widget class="QCheckBox" name="italic6"> + <item row="3" column="4"> + <widget class="QCheckBox" name="italic2"> <property name="text"> <string>Italic</string> </property> </widget> </item> - <item row="7" column="5"> - <widget class="QToolButton" name="fontBrowse6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <item row="4" column="3"> + <widget class="QCheckBox" name="bold3"> <property name="text"> - <string>...</string> + <string>Bold</string> </property> </widget> </item> - <item row="5" column="2"> - <widget class="QSpinBox" name="fontSize4"> + <item row="4" column="5"> + <widget class="QToolButton" name="fontBrowse3"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - </widget> - </item> - <item row="6" column="2"> - <widget class="QSpinBox" name="fontSize5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="text"> + <string>...</string> </property> </widget> </item> - <item row="5" column="3"> - <widget class="QCheckBox" name="bold4"> + <item row="1" column="4"> + <widget class="QCheckBox" name="italic0"> <property name="text"> - <string>Bold</string> + <string>Italic</string> </property> </widget> </item> - <item row="6" column="3"> - <widget class="QCheckBox" name="bold5"> + <item row="1" column="3"> + <widget class="QCheckBox" name="bold0"> <property name="text"> <string>Bold</string> </property> </widget> </item> - <item row="5" column="4"> - <widget class="QCheckBox" name="italic4"> + <item row="5" column="0"> + <widget class="QLabel" name="textLabel7"> <property name="text"> - <string>Italic</string> + <string>Font 4</string> + </property> + <property name="wordWrap"> + <bool>false</bool> </property> </widget> </item> - <item row="6" column="4"> - <widget class="QCheckBox" name="italic5"> + <item row="5" column="4"> + <widget class="QCheckBox" name="italic4"> <property name="text"> <string>Italic</string> </property> </widget> </item> - <item row="5" column="5"> - <widget class="QToolButton" name="fontBrowse4"> + <item row="3" column="2"> + <widget class="QSpinBox" name="fontSize2"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>...</string> - </property> </widget> </item> - <item row="6" column="5"> - <widget class="QToolButton" name="fontBrowse5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <item row="0" column="2"> + <widget class="QLabel" name="TextLabel1_1"> <property name="text"> - <string>...</string> + <string>Size</string> + </property> + <property name="wordWrap"> + <bool>false</bool> </property> </widget> </item> @@ -1737,6 +1736,14 @@ </layout> </widget> <layoutdefault spacing="6" margin="11"/> + <customwidgets> + <customwidget> + <class>ColorFrame</class> + <extends>QWidget</extends> + <header>colorframe.h</header> + <container>1</container> + </customwidget> + </customwidgets> <tabstops> <tabstop>TabWidget2</tabstop> <tabstop>itemList</tabstop> diff --git a/muse2/muse/widgets/colorframe.cpp b/muse2/muse/widgets/colorframe.cpp new file mode 100644 index 00000000..8e61ae4b --- /dev/null +++ b/muse2/muse/widgets/colorframe.cpp @@ -0,0 +1,17 @@ +#include <QPainter> +#include <QPaintEvent> + +#include "colorframe.h" + +ColorFrame::ColorFrame(QWidget *parent) : + QWidget(parent) +{ +} + +void ColorFrame::paintEvent(QPaintEvent *e) +{ + QRect r(e->rect()); + QPainter p(this); + p.fillRect(r, color); +} + diff --git a/muse2/muse/widgets/colorframe.h b/muse2/muse/widgets/colorframe.h new file mode 100644 index 00000000..8dc940f5 --- /dev/null +++ b/muse2/muse/widgets/colorframe.h @@ -0,0 +1,23 @@ +#ifndef COLORFRAME_H +#define COLORFRAME_H + +#include <QWidget> + +class ColorFrame : public QWidget +{ + Q_OBJECT + virtual void paintEvent(QPaintEvent*); + +public: + explicit ColorFrame(QWidget *parent = 0); + void setColor(QColor c) {color = c; update();} + +signals: + +public slots: + +private: + QColor color; +}; + +#endif // COLORFRAME_H diff --git a/muse2/muse/widgets/mtscale.cpp b/muse2/muse/widgets/mtscale.cpp index e15d22fa..bcf6ad0c 100644 --- a/muse2/muse/widgets/mtscale.cpp +++ b/muse2/muse/widgets/mtscale.cpp @@ -281,7 +281,7 @@ void MTScale::pdraw(QPainter& p, const QRect& r) { if (m->second.current()) { - p.fillRect(tr, Qt::white); + p.fillRect(tr, MusEGlobal::config.rulerCurrent); } int x2; diff --git a/muse2/muse/widgets/mtscale_flo.cpp b/muse2/muse/widgets/mtscale_flo.cpp index 3b6ea502..f043d461 100644 --- a/muse2/muse/widgets/mtscale_flo.cpp +++ b/muse2/muse/widgets/mtscale_flo.cpp @@ -224,7 +224,7 @@ void MTScaleFlo::draw(QPainter& p, const QRect& r) if(!wr.isEmpty()) { if (m->second.current()) - p.fillRect(wr, Qt::white); + p.fillRect(wr, MusEGlobal::config.rulerCurrent); int x2; if (mm != marker->end()) |