From 7db552d8e41a4ac876802b3d4ac7d8a6e0dd2ed5 Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Thu, 30 Dec 2010 09:37:30 +0000 Subject: Please see ChangeLog. --- muse2/ChangeLog | 8 + muse2/muse/app.cpp | 1 - muse2/muse/appearance.cpp | 167 ++++- muse2/muse/appearance.h | 2 + muse2/muse/arranger/pcanvas.cpp | 6 +- muse2/muse/conf.cpp | 76 ++ muse2/muse/gconfig.cpp | 44 +- muse2/muse/gconfig.h | 20 +- muse2/muse/mixer/strip.cpp | 27 +- muse2/muse/widgets/appearancebase.ui | 1267 +++++++++++++++++++------------- muse2/muse/widgets/mtrackinfo.cpp | 28 +- muse2/muse/widgets/musewidgetsplug.cpp | 58 +- 12 files changed, 1148 insertions(+), 556 deletions(-) diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 8cbef449..c10e4ed8 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,11 @@ +30.12.2010: + *Feature: Appearance part color names now can now be edited. (Tim) + TODO: Add per-song settings and add toolbar with some colour goodies. + *Feature: Mixer label colours can now be edited in the appearance settings. (Tim) + TODO: Remix track icons using use alpha channel and special routine to mix in + these settable colours. + *Fixed: Appearance settings palette was broken. (Tim) + Note: A few odd Qt styles are wacky (Motif, Windows). Your mileage may vary. 29.12.2010: - Fixed Bigtime display when using a style sheet for MusE. (Tim) Set window font using a style sheet. Bigtime used QFont::setPixelSize(). diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index c2202e7a..968c9388 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -1216,7 +1216,6 @@ MusE::MusE(int argc, char** argv) : QMainWindow() //-------------------------------------------------- tools = addToolBar(tr("File Buttons")); - tools->addAction(fileNewAction); tools->addAction(fileOpenAction); tools->addAction(fileSaveAction); diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index 7cd3e9ec..997da343 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -99,6 +99,9 @@ Appearance::Appearance(Arranger* a, QWidget* parent) color = 0; config = new GlobalConfigValues; + lastSelectedColorItem = 0; + lastSelectedBgItem = 0; + fontName0->setToolTip(tr("Main application font, and default font for any\n controls not defined here.")); fontName1->setToolTip(tr("For small controls like mixer strips.\nAlso timescale small numbers, arranger part name overlay,\n and effects rack.")); fontName2->setToolTip(tr("Midi track info panel. Transport controls.")); @@ -159,6 +162,8 @@ Appearance::Appearance(Arranger* a, QWidget* parent) itemList->clear(); aid = new IdListViewItem(0, itemList, "Arranger"); id = new IdListViewItem(0, aid, "PartColors"); + // Names moved into global config by Tim. + /* new IdListViewItem(0x400, id, "Default"); new IdListViewItem(0x401, id, "Refrain"); new IdListViewItem(0x402, id, "Bridge"); @@ -176,6 +181,10 @@ Appearance::Appearance(Arranger* a, QWidget* parent) new IdListViewItem(0x40e, id, "Keyboard"); new IdListViewItem(0x40f, id, "Piano"); new IdListViewItem(0x410, id, "Saxophon"); + */ + for(int i = 0; i < NUM_PARTCOLORS; ++i) + new IdListViewItem(0x400 + i, id, ::config.partColorNames[i]); + new IdListViewItem(0x41c, aid, "part canvas background"); id = new IdListViewItem(0, aid, "Track List"); new IdListViewItem(0x411, id, "background"); @@ -198,7 +207,20 @@ Appearance::Appearance(Arranger* a, QWidget* parent) new IdListViewItem(0x41d, id, "controller graph"); id = new IdListViewItem(0, itemList, "Wave Editor"); new IdListViewItem(0x300, id, "background"); - + id = new IdListViewItem(0, itemList, "Mixer"); + new IdListViewItem(0x500, id, "background"); + new IdListViewItem(0x501, id, "midi label"); + new IdListViewItem(0x502, id, "drum label"); + new IdListViewItem(0x503, id, "wave label"); + new IdListViewItem(0x504, id, "audio output label"); + new IdListViewItem(0x505, id, "audio input label"); + new IdListViewItem(0x506, id, "group label"); + new IdListViewItem(0x507, id, "aux label"); + new IdListViewItem(0x508, id, "synth label"); + + colorNameLineEdit->setEnabled(false); + + connect(colorNameLineEdit, SIGNAL(editingFinished()), SLOT(colorNameEditFinished())); connect(itemList, SIGNAL(itemSelectionChanged()), SLOT(colorItemSelectionChanged())); connect(aPalette, SIGNAL(buttonClicked(int)), SLOT(paletteClicked(int))); connect(globalAlphaSlider, SIGNAL(valueChanged(int)), SLOT(asliderChanged(int))); @@ -282,6 +304,7 @@ void Appearance::resetValues() QPalette pal; + /* pal.setColor(palette0->backgroundRole(), config->palette[0]); palette0->setPalette(pal); pal.setColor(palette1->backgroundRole(), config->palette[1]); @@ -314,7 +337,95 @@ void Appearance::resetValues() palette14->setPalette(pal); pal.setColor(palette15->backgroundRole(), config->palette[15]); palette15->setPalette(pal); + */ + /* + pal.setColor(QPalette::Window, config->palette[0]); + palette0->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[1]); + palette1->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[2]); + palette2->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[3]); + palette3->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[4]); + palette4->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[5]); + palette5->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[6]); + palette6->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[7]); + palette7->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[8]); + palette8->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[9]); + palette9->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[10]); + palette10->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[11]); + palette11->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[12]); + palette12->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[13]); + palette13->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[14]); + palette14->setPalette(pal); + pal.setColor(QPalette::Window, config->palette[15]); + palette15->setPalette(pal); + */ + + /* + pal.setColor(QPalette::Button, config->palette[0]); + palette0->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[1]); + palette1->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[2]); + palette2->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[3]); + palette3->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[4]); + palette4->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[5]); + palette5->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[6]); + palette6->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[7]); + palette7->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[8]); + palette8->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[9]); + palette9->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[10]); + palette10->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[11]); + palette11->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[12]); + palette12->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[13]); + palette13->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[14]); + palette14->setPalette(pal); + pal.setColor(QPalette::Button, config->palette[15]); + palette15->setPalette(pal); + */ + + palette0->setStyleSheet(QString("background-color: ") + config->palette[0].name()); + palette1->setStyleSheet(QString("background-color: ") + config->palette[1].name()); + palette2->setStyleSheet(QString("background-color: ") + config->palette[2].name()); + palette3->setStyleSheet(QString("background-color: ") + config->palette[3].name()); + palette4->setStyleSheet(QString("background-color: ") + config->palette[4].name()); + palette5->setStyleSheet(QString("background-color: ") + config->palette[5].name()); + palette6->setStyleSheet(QString("background-color: ") + config->palette[6].name()); + palette7->setStyleSheet(QString("background-color: ") + config->palette[7].name()); + palette8->setStyleSheet(QString("background-color: ") + config->palette[8].name()); + palette9->setStyleSheet(QString("background-color: ") + config->palette[9].name()); + palette10->setStyleSheet(QString("background-color: ") + config->palette[10].name()); + palette11->setStyleSheet(QString("background-color: ") + config->palette[11].name()); + palette12->setStyleSheet(QString("background-color: ") + config->palette[12].name()); + palette13->setStyleSheet(QString("background-color: ") + config->palette[13].name()); + palette14->setStyleSheet(QString("background-color: ") + config->palette[14].name()); + palette15->setStyleSheet(QString("background-color: ") + config->palette[15].name()); + global_bg->takeChildren(); user_bg->takeChildren(); @@ -565,6 +676,29 @@ void Appearance::apply() muse->changeConfig(true); } +//--------------------------------------------------------- +// colorNameEditFinished +//--------------------------------------------------------- + +void Appearance::colorNameEditFinished() +{ + if(!lastSelectedColorItem) + return; + + IdListViewItem* item = (IdListViewItem*)lastSelectedColorItem; + int id = item->id(); + if(id == 0) + return; + + QString etxt = colorNameLineEdit->text(); + QString txt = item->text(0); + // We only support part color names, for now. + if(id >= 0x400 && id < (0x400 + NUM_PARTCOLORS)) + config->partColorNames[id & 0xff] = etxt; + if(etxt != txt) + item->setText(0, etxt); +} + //--------------------------------------------------------- // ok //--------------------------------------------------------- @@ -643,12 +777,16 @@ void Appearance::clearBackground() void Appearance::colorItemSelectionChanged() { IdListViewItem* item = (IdListViewItem*)itemList->selectedItems()[0]; + lastSelectedColorItem = 0; QString txt = item->text(0); int id = item->id(); if (id == 0) { color = 0; + lastSelectedColorItem = 0; + colorNameLineEdit->setEnabled(false); return; } + bool enle = false; switch(id) { case 0x400: // "Default" case 0x401: // "Refrain" @@ -667,7 +805,9 @@ void Appearance::colorItemSelectionChanged() case 0x40e: // "Keyboard case 0x40f: // "Piano case 0x410: // "Saxophon + lastSelectedColorItem = item; color = &config->partColors[id & 0xff]; + enle = true; break; case 0x100: color = &config->bigTimeBackgroundColor; break; case 0x101: color = &config->bigTimeForegroundColor; break; @@ -687,10 +827,25 @@ void Appearance::colorItemSelectionChanged() case 0x41c: color = &config->partCanvasBg; break; case 0x41d: color = &config->ctrlGraphFg; break; + case 0x500: color = &config->mixerBg; break; + case 0x501: color = &config->midiTrackLabelBg; break; + case 0x502: color = &config->drumTrackLabelBg; break; + case 0x503: color = &config->waveTrackLabelBg; break; + case 0x504: color = &config->outputTrackLabelBg; break; + case 0x505: color = &config->inputTrackLabelBg; break; + case 0x506: color = &config->groupTrackLabelBg; break; + case 0x507: color = &config->auxTrackLabelBg; break; + case 0x508: color = &config->synthTrackLabelBg; break; + default: color = 0; break; } + colorNameLineEdit->setEnabled(enle); + QString s; + if(enle) + s = config->partColorNames[id & 0xff]; + colorNameLineEdit->setText(s); updateColor(); } @@ -875,9 +1030,12 @@ void Appearance::addToPaletteClicked() if (button) { int id = aPalette->id(button); config->palette[id] = *color; - QPalette pal; - pal.setColor(button->backgroundRole(), *color); - button->setPalette(pal); + //QPalette pal; + //pal.setColor(button->backgroundRole(), *color); + //pal.setColor(QPalette::Window, *color); + //pal.setColor(QPalette::Button, *color); + //button->setPalette(pal); + button->setStyleSheet(QString("background-color: ") + color->name()); button->update(); //?? } } @@ -893,6 +1051,7 @@ void Appearance::paletteClicked(int id) QAbstractButton* button = (QAbstractButton*)aPalette->button(id); // ddskrjo if (button) { QColor c = button->palette().color(QPalette::Window); + //QColor c = button->palette().color(button->backgroundRole()); int r, g, b; c.getRgb(&r, &g, &b); if (r == 0xff && g == 0xff && b == 0xff) diff --git a/muse2/muse/appearance.h b/muse2/muse/appearance.h index 851888b8..ef99adbe 100644 --- a/muse2/muse/appearance.h +++ b/muse2/muse/appearance.h @@ -22,6 +22,7 @@ class Appearance : public QDialog, public Ui::AppearanceDialogBase { QTreeWidgetItem* user_bg; QTreeWidgetItem* global_bg; QTreeWidgetItem* lastSelectedBgItem; + QTreeWidgetItem* lastSelectedColorItem; Q_OBJECT void updateFonts(); @@ -56,6 +57,7 @@ class Appearance : public QDialog, public Ui::AppearanceDialogBase { void addToPaletteClicked(); void paletteClicked(int); void bgSelectionChanged(QTreeWidgetItem*); + void colorNameEditFinished(); public: Appearance(Arranger*, QWidget* parent=0); diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 984d6eaa..ae0392d8 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -35,6 +35,8 @@ #include "filedialog.h" #include "marker/marker.h" +// Moved into global config by Tim. +/* const char* partColorNames[] = { "Default", "Refrain", @@ -54,6 +56,8 @@ const char* partColorNames[] = { "Piano", "Saxophon", }; +*/ + /* //--------------------------------------------------------- // ColorListItem @@ -749,7 +753,7 @@ QMenu* PartCanvas::genItemPopup(CItem* item) for (int i = 0; i < NUM_PARTCOLORS; ++i) { //ColorListItem* item = new ColorListItem(config.partColors[i], h, fontMetrics().height(), partColorNames[i]); //ddskrjo - QAction *act_color = colorPopup->addAction(colorRect(config.partColors[i], 80, 80), partColorNames[i]); + QAction *act_color = colorPopup->addAction(colorRect(config.partColors[i], 80, 80), config.partColorNames[i]); act_color->setData(20+i); } diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 02565712..328224f3 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -609,6 +609,44 @@ void readConfiguration(Xml& xml, bool readOnlySequencer) config.partColors[16] = readColor(xml); else if (tag == "partColor17") config.partColors[17] = readColor(xml); + + else if (tag == "partColorName0") + config.partColorNames[0] = xml.parse1(); + else if (tag == "partColorName1") + config.partColorNames[1] = xml.parse1(); + else if (tag == "partColorName2") + config.partColorNames[2] = xml.parse1(); + else if (tag == "partColorName3") + config.partColorNames[3] = xml.parse1(); + else if (tag == "partColorName4") + config.partColorNames[4] = xml.parse1(); + else if (tag == "partColorName5") + config.partColorNames[5] = xml.parse1(); + else if (tag == "partColorName6") + config.partColorNames[6] = xml.parse1(); + else if (tag == "partColorName7") + config.partColorNames[7] = xml.parse1(); + else if (tag == "partColorName8") + config.partColorNames[8] = xml.parse1(); + else if (tag == "partColorName9") + config.partColorNames[9] = xml.parse1(); + else if (tag == "partColorName10") + config.partColorNames[10] = xml.parse1(); + else if (tag == "partColorName11") + config.partColorNames[11] = xml.parse1(); + else if (tag == "partColorName12") + config.partColorNames[12] = xml.parse1(); + else if (tag == "partColorName13") + config.partColorNames[13] = xml.parse1(); + else if (tag == "partColorName14") + config.partColorNames[14] = xml.parse1(); + else if (tag == "partColorName15") + config.partColorNames[15] = xml.parse1(); + else if (tag == "partColorName16") + config.partColorNames[16] = xml.parse1(); + else if (tag == "partColorName17") + config.partColorNames[17] = xml.parse1(); + else if (tag == "partCanvasBg") config.partCanvasBg = readColor(xml); else if (tag == "trackBg") @@ -617,6 +655,26 @@ void readConfiguration(Xml& xml, bool readOnlySequencer) config.selectTrackBg = readColor(xml); else if (tag == "selectTrackFg") config.selectTrackFg = readColor(xml); + + else if (tag == "mixerBg") + config.mixerBg = readColor(xml); + else if (tag == "midiTrackLabelBg") + config.midiTrackLabelBg = readColor(xml); + else if (tag == "drumTrackLabelBg") + config.drumTrackLabelBg = readColor(xml); + else if (tag == "waveTrackLabelBg") + config.waveTrackLabelBg = readColor(xml); + else if (tag == "outputTrackLabelBg") + config.outputTrackLabelBg = readColor(xml); + else if (tag == "inputTrackLabelBg") + config.inputTrackLabelBg = readColor(xml); + else if (tag == "groupTrackLabelBg") + config.groupTrackLabelBg = readColor(xml); + else if (tag == "auxTrackLabelBg") + config.auxTrackLabelBg = readColor(xml); + else if (tag == "synthTrackLabelBg") + config.synthTrackLabelBg = readColor(xml); + else if (tag == "midiTrackBg") config.midiTrackBg = readColor(xml); else if (tag == "ctrlGraphFg") @@ -635,6 +693,7 @@ void readConfiguration(Xml& xml, bool readOnlySequencer) config.auxTrackBg = readColor(xml); else if (tag == "synthTrackBg") config.synthTrackBg = readColor(xml); + else if (tag == "extendedMidi") config.extendedMidi = xml.parseInt(); else if (tag == "midiExportDivision") @@ -1141,10 +1200,27 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const xml.colorTag(level, buffer, config.partColors[i]); } + for (int i = 0; i < NUM_PARTCOLORS; ++i) { + char buffer[32]; + sprintf(buffer, "partColorName%d", i); + xml.strTag(level, buffer, config.partColorNames[i]); + } + xml.colorTag(level, "partCanvasBg", config.partCanvasBg); xml.colorTag(level, "trackBg", config.trackBg); xml.colorTag(level, "selectTrackBg", config.selectTrackBg); xml.colorTag(level, "selectTrackFg", config.selectTrackFg); + + xml.colorTag(level, "mixerBg", config.mixerBg); + xml.colorTag(level, "midiTrackLabelBg", config.midiTrackLabelBg); + xml.colorTag(level, "drumTrackLabelBg", config.drumTrackLabelBg); + xml.colorTag(level, "waveTrackLabelBg", config.waveTrackLabelBg); + xml.colorTag(level, "outputTrackLabelBg", config.outputTrackLabelBg); + xml.colorTag(level, "inputTrackLabelBg", config.inputTrackLabelBg); + xml.colorTag(level, "groupTrackLabelBg", config.groupTrackLabelBg); + xml.colorTag(level, "auxTrackLabelBg", config.auxTrackLabelBg); + xml.colorTag(level, "synthTrackLabelBg", config.synthTrackLabelBg); + xml.colorTag(level, "midiTrackBg", config.midiTrackBg); xml.colorTag(level, "ctrlGraphFg", config.ctrlGraphFg); xml.colorTag(level, "drumTrackBg", config.drumTrackBg); diff --git a/muse2/muse/gconfig.cpp b/muse2/muse/gconfig.cpp index 2b0caafb..944035a7 100644 --- a/muse2/muse/gconfig.cpp +++ b/muse2/muse/gconfig.cpp @@ -46,10 +46,29 @@ GlobalConfigValues config = { QColor(0x7f, 0x00, 0x7f), QColor(0x00, 0x7f, 0xff), QColor(0x00, 0x3f, 0x3f) - }, - QColor(0, 0, 255), // transportHandleColor; - QColor(255, 0, 0), // bigTimeForegroundColor; - QColor(0, 0, 0), // bigTimeBackgroundColor; + }, + { + QString("Default"), // Default part color names + QString("Refrain"), + QString("Bridge"), + QString("Intro"), + QString("Coda"), + QString("Chorus"), + QString("Solo"), + QString("Brass"), + QString("Percussion"), + QString("Drums"), + QString("Guitar"), + QString("Bass"), + QString("Flute"), + QString("Strings"), + QString("Keyboard"), + QString("Piano"), + QString("Saxophone") + }, + QColor(0, 0, 255), // transportHandleColor; + QColor(255, 0, 0), // bigTimeForegroundColor; + QColor(0, 0, 0), // bigTimeBackgroundColor; QColor(200, 200, 200), // waveEditBackgroundColor; { QFont(QString("arial"), 10, QFont::Normal), @@ -64,8 +83,17 @@ GlobalConfigValues config = { QColor(84, 97, 114), // trackBg; QColor(0x80, 0xff, 0x80), // selected track Bg; QColor(0x00, 0x00, 0x00), // selected track Fg; + + QColor(0, 160, 255), // midiTrackLabelBg; // Med blue + QColor(0, 160, 255), // drumTrackLabelBg; // Med blue + Qt::magenta, // waveTrackLabelBg; + Qt::green, // outputTrackLabelBg; + Qt::red, // inputTrackLabelBg; + Qt::yellow, // groupTrackLabelBg; + QColor(120, 255, 255), // auxTrackLabelBg; // Light blue + QColor(255, 130, 0), // synthTrackLabelBg; // Med orange + QColor(220, 220, 220), // midiTrackBg; - QColor(255, 170, 0), // ctrlGraphFg; Medium orange QColor(220, 220, 220), // drumTrackBg; QColor(220, 220, 220), // waveTrackBg; QColor(189, 220, 193), // outputTrackBg; @@ -73,8 +101,10 @@ GlobalConfigValues config = { QColor(220, 220, 220), // groupTrackBg; QColor(220, 220, 220), // auxTrackBg; QColor(220, 220, 220), // synthTrackBg; - QColor(98, 124, 168), // part canvas bg - QColor(0, 0, 0), // mixerBg; + + QColor(98, 124, 168), // part canvas bg + QColor(255, 170, 0), // ctrlGraphFg; Medium orange + QColor(0, 0, 0), // mixerBg; 384, // division; 1024, // rtcTicks diff --git a/muse2/muse/gconfig.h b/muse2/muse/gconfig.h index f58b1a51..2eeea7cb 100644 --- a/muse2/muse/gconfig.h +++ b/muse2/muse/gconfig.h @@ -51,17 +51,27 @@ struct GlobalConfigValues { int globalAlphaBlend; QColor palette[16]; QColor partColors[NUM_PARTCOLORS]; - QColor transportHandleColor; - QColor bigTimeForegroundColor; - QColor bigTimeBackgroundColor; + QString partColorNames[NUM_PARTCOLORS]; + QColor transportHandleColor; + QColor bigTimeForegroundColor; + QColor bigTimeBackgroundColor; QColor waveEditBackgroundColor; //QFont fonts[6]; QFont fonts[NUM_FONTS]; QColor trackBg; QColor selectTrackBg; QColor selectTrackFg; + + QColor midiTrackLabelBg; + QColor drumTrackLabelBg; + QColor waveTrackLabelBg; + QColor outputTrackLabelBg; + QColor inputTrackLabelBg; + QColor groupTrackLabelBg; + QColor auxTrackLabelBg; + QColor synthTrackLabelBg; + QColor midiTrackBg; - QColor ctrlGraphFg; QColor drumTrackBg; QColor waveTrackBg; QColor outputTrackBg; @@ -69,7 +79,9 @@ struct GlobalConfigValues { QColor groupTrackBg; QColor auxTrackBg; QColor synthTrackBg; + QColor partCanvasBg; + QColor ctrlGraphFg; QColor mixerBg; int division; diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp index 30515129..0c4059d8 100644 --- a/muse2/muse/mixer/strip.cpp +++ b/muse2/muse/mixer/strip.cpp @@ -94,28 +94,36 @@ void Strip::setLabelText() QColor c; switch(track->type()) { case Track::AUDIO_OUTPUT: - c = Qt::green; + //c = Qt::green; + c = config.outputTrackLabelBg; break; case Track::AUDIO_GROUP: - c = Qt::yellow; + //c = Qt::yellow; + c = config.groupTrackLabelBg; break; case Track::AUDIO_AUX: - c = QColor(120, 255, 255); // Light blue + //c = QColor(120, 255, 255); // Light blue + c = config.auxTrackLabelBg; break; case Track::WAVE: - c = Qt::magenta; + //c = Qt::magenta; + c = config.waveTrackLabelBg; break; case Track::AUDIO_INPUT: - c = Qt::red; + //c = Qt::red; + c = config.inputTrackLabelBg; break; case Track::AUDIO_SOFTSYNTH: - c = QColor(255, 130, 0); // Med orange + //c = QColor(255, 130, 0); // Med orange + c = config.synthTrackLabelBg; break; case Track::MIDI: + //c = QColor(0, 160, 255); // Med blue + c = config.midiTrackLabelBg; + break; case Track::DRUM: - { - c = QColor(0, 160, 255); // Med blue - } + //c = QColor(0, 160, 255); // Med blue + c = config.drumTrackLabelBg; break; default: return; @@ -125,6 +133,7 @@ void Strip::setLabelText() QPalette palette; palette.setColor(label->backgroundRole(), c); label->setPalette(palette); + //label->setStyleSheet(QString("background-color: ") + c.name()); } //--------------------------------------------------------- diff --git a/muse2/muse/widgets/appearancebase.ui b/muse2/muse/widgets/appearancebase.ui index 67f1ea7c..b739e3f5 100644 --- a/muse2/muse/widgets/appearancebase.ui +++ b/muse2/muse/widgets/appearancebase.ui @@ -6,8 +6,8 @@ 0 0 - 591 - 633 + 538 + 531 @@ -204,526 +204,783 @@ Colors - - - - - - - Qt::NoFocus - - - Palette - - - 0 - - - - 0 + + + + + true + + + true + + + + Items + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + Palette + + + 0 + + + + + + + 0 + 0 + - - - - - 0 - 0 - - - - - - - true - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - - 0 - 0 - - - - - - - true - - - - + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + false + + + + + + true + + + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Sunken + - + add to palette - - + + + + + + + + 255 + + + + + + + 255 + + + Qt::Horizontal + + + + + + + B + + + Qt::AlignCenter + + + false + + + + + + + S + + + Qt::AlignCenter + + + false + + + + + + + H + + + Qt::AlignCenter + + + false + + + + + + + 255 + + + + + + + 255 + + + Qt::Horizontal + + + + + + + V + + + Qt::AlignCenter + + + false + + + + + + + G + + + Qt::AlignCenter + + + false + + + + + + + 255 + + + + + + + 255 + + + Qt::Horizontal + + + + + + + 255 + + + Qt::Horizontal + + + + + + + 255 + + + Qt::Horizontal + + + + + + + 255 + + + + + - + 0 0 - - QFrame::StyledPanel + + 0 - - QFrame::Sunken + + 255 + + + true + + + Qt::Horizontal + + + QSlider::NoTicks - - - - - - 255 - - - - - - - 255 - - - Qt::Horizontal - - - - - - - B - - - Qt::AlignCenter - - - false - - - - - - - S - - - Qt::AlignCenter - - - false - - - - - - - H - - - Qt::AlignCenter - - - false - - - - - - - 255 - - - - - - - 255 - - - Qt::Horizontal - - - - - - - V - - - Qt::AlignCenter - - - false - - - - - - - G - - - Qt::AlignCenter - - - false - - - - - - - 255 - - - - - - - 255 - - - Qt::Horizontal - - - - - - - 255 - - - Qt::Horizontal - - - - - - - 255 - - - Qt::Horizontal - - - - - - - 255 - - - - - - - - 0 - 0 - - - - 0 - - - 255 - - - true - - - Qt::Horizontal - - - QSlider::NoTicks - - - - - - - 255 - - - - - - - 255 - - - - - - - R - - - Qt::AlignCenter - - - false - - - - + + + + 255 + + - - - - true + + + + 255 - - true + + + + + + R + + + Qt::AlignCenter + + + false - - - Items - - - + + + + + + Color name: + + + + + + + + + @@ -778,22 +1035,6 @@ - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp index af957dd2..f9903037 100644 --- a/muse2/muse/widgets/mtrackinfo.cpp +++ b/muse2/muse/widgets/mtrackinfo.cpp @@ -42,6 +42,14 @@ void MidiTrackInfo::setTrack(Track* t) if(!t->isMidiTrack()) return; selected = t; + + QPalette pal; + if(selected->type() == Track::DRUM) + pal.setColor(trackNameLabel->backgroundRole(), config.drumTrackLabelBg); + else + pal.setColor(trackNameLabel->backgroundRole(), config.midiTrackLabelBg); + trackNameLabel->setPalette(pal); + updateTrackInfo(-1); } @@ -71,6 +79,7 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent recEchoIconSet.addPixmap(*midiThruOnIcon, QIcon::Normal, QIcon::On); recEchoIconSet.addPixmap(*midiThruOffIcon, QIcon::Normal, QIcon::Off); recEchoButton->setIcon(recEchoIconSet); + recEchoButton->setIconSize(midiThruOnIcon->size()); // MusE-2: AlignCenter and WordBreak are set in the ui(3) file, but not supported by QLabel. Turn them on here. trackNameLabel->setAlignment(Qt::AlignCenter); @@ -81,10 +90,23 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent //trackNameLabel->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); if(selected) + { trackNameLabel->setObjectName(selected->cname()); - QPalette pal; - pal.setColor(trackNameLabel->backgroundRole(), QColor(0, 160, 255)); // Med blue - trackNameLabel->setPalette(pal); + QPalette pal; + //pal.setColor(trackNameLabel->backgroundRole(), QColor(0, 160, 255)); // Med blue + if(selected->type() == Track::DRUM) + pal.setColor(trackNameLabel->backgroundRole(), config.drumTrackLabelBg); + else + pal.setColor(trackNameLabel->backgroundRole(), config.midiTrackLabelBg); + trackNameLabel->setPalette(pal); + } + //else + //{ + // pal.setColor(trackNameLabel->backgroundRole(), config.midiTrackLabelBg); + // trackNameLabel->setPalette(pal); + //} + + //trackNameLabel->setStyleSheet(QString("background-color: ") + QColor(0, 160, 255).name()); // Med blue trackNameLabel->setWordWrap(true); trackNameLabel->setAutoFillBackground(true); trackNameLabel->setTextFormat(Qt::PlainText); diff --git a/muse2/muse/widgets/musewidgetsplug.cpp b/muse2/muse/widgets/musewidgetsplug.cpp index e5858bd4..4b61cf2a 100644 --- a/muse2/muse/widgets/musewidgetsplug.cpp +++ b/muse2/muse/widgets/musewidgetsplug.cpp @@ -76,10 +76,29 @@ GlobalConfigValues config = { QColor(0x7f, 0x00, 0x7f), QColor(0x00, 0x7f, 0xff), QColor(0x00, 0x3f, 0x3f) - }, - QColor(0, 0, 255), // transportHandleColor; - QColor(255, 0, 0), // bigTimeForegroundColor; - QColor(0, 0, 0), // bigTimeBackgroundColor; + }, + { + QString("Default"), // Default part color names + QString("Refrain"), + QString("Bridge"), + QString("Intro"), + QString("Coda"), + QString("Chorus"), + QString("Solo"), + QString("Brass"), + QString("Percussion"), + QString("Drums"), + QString("Guitar"), + QString("Bass"), + QString("Flute"), + QString("Strings"), + QString("Keyboard"), + QString("Piano"), + QString("Saxophone") + }, + QColor(0, 0, 255), // transportHandleColor; + QColor(255, 0, 0), // bigTimeForegroundColor; + QColor(0, 0, 0), // bigTimeBackgroundColor; QColor(200, 200, 200), // waveEditBackgroundColor; { QFont(QString("arial"), 10, QFont::Normal), @@ -94,17 +113,28 @@ GlobalConfigValues config = { QColor(0xff, 0xff, 0xff), // trackBg; QColor(0x80, 0xff, 0x80), // selected track Bg; QColor(0x00, 0x00, 0x00), // selected track Fg; - QColor(0xff, 0xff, 0xff), // midiTrackBg; - QColor(255, 170, 0), // ctrlGraphFg; Medium orange - QColor(0xff, 0xff, 0xff), // drumTrackBg; - QColor(0xff, 0xff, 0xff), // waveTrackBg; - QColor(0xff, 0xff, 0xff), // outputTrackBg; - QColor(0xff, 0xff, 0xff), // inputTrackBg; - QColor(0xff, 0xff, 0xff), // groupTrackBg; - QColor(0xff, 0xff, 0xff), // auxTrackBg; - QColor(0xff, 0xff, 0xff), // synthTrackBg; + + QColor(0, 160, 255), // midiTrackLabelBg; // Med blue + QColor(0, 160, 255), // drumTrackLabelBg; // Med blue + Qt::magenta, // waveTrackLabelBg; + Qt::green, // outputTrackLabelBg; + Qt::red, // inputTrackLabelBg; + Qt::yellow, // groupTrackLabelBg; + QColor(120, 255, 255), // auxTrackLabelBg; // Light blue + QColor(255, 130, 0), // synthTrackLabelBg; // Med orange + + QColor(220, 220, 220), // midiTrackBg; + QColor(220, 220, 220), // drumTrackBg; + QColor(220, 220, 220), // waveTrackBg; + QColor(189, 220, 193), // outputTrackBg; + QColor(189, 220, 193), // inputTrackBg; + QColor(220, 220, 220), // groupTrackBg; + QColor(220, 220, 220), // auxTrackBg; + QColor(220, 220, 220), // synthTrackBg; + QColor(98, 124, 168), // part canvas bg - QColor(98, 124, 168), // mixerBg; + QColor(255, 170, 0), // ctrlGraphFg; Medium orange + QColor(98, 124, 168), // mixerBg; 384, // division; 1024, // rtcTicks -- cgit v1.2.3