From 98f6d7feddcde52442ee1af5e2254f4d324ebf9b Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Fri, 1 Sep 2006 14:03:36 +0000 Subject: color config updates --- muse/awl/tcanvas.cpp | 1 - muse/muse/CMakeLists.txt | 2 + muse/muse/conf.cpp | 40 ++--- muse/muse/gconfig.cpp | 18 -- muse/muse/gconfig.h | 1 - muse/muse/preferences.cpp | 73 ++++---- muse/muse/preferences.ui | 428 +++++++++++++++++++++++++--------------------- 7 files changed, 288 insertions(+), 275 deletions(-) diff --git a/muse/awl/tcanvas.cpp b/muse/awl/tcanvas.cpp index 8027cccc..ef515f50 100644 --- a/muse/awl/tcanvas.cpp +++ b/muse/awl/tcanvas.cpp @@ -935,7 +935,6 @@ void TimeCanvas::canvasPaintEvent(const QRect& r, QPainter& p) void TimeCanvas::paintCanvas(QPainter& p, const QRect& cr) { - return; QPoint off(rCanvasA.topLeft()); if (type == TIME_CANVAS_PIANOROLL) { diff --git a/muse/muse/CMakeLists.txt b/muse/muse/CMakeLists.txt index f40eb74f..a0b5f7d3 100644 --- a/muse/muse/CMakeLists.txt +++ b/muse/muse/CMakeLists.txt @@ -126,6 +126,8 @@ add_executable ( muse midiedit/drummap.cpp midiedit/citem.cpp + midiedit/midicmd.h + midiedit/midicmd.cpp ${muse_mocCPP} ${muse_moc_headers} diff --git a/muse/muse/conf.cpp b/muse/muse/conf.cpp index 1265acc1..e250622b 100644 --- a/muse/muse/conf.cpp +++ b/muse/muse/conf.cpp @@ -78,39 +78,37 @@ void readConfiguration(QDomNode node) else if (tag == "font5") config.fonts[5]->fromString(s); else if (tag == "palette0") - config.palette[0] = readColor(node); + QColorDialog::setCustomColor(0, readColor(node).rgb()); else if (tag == "palette1") - config.palette[1] = readColor(node); + QColorDialog::setCustomColor(1, readColor(node).rgb()); else if (tag == "palette2") - config.palette[2] = readColor(node); + QColorDialog::setCustomColor(2, readColor(node).rgb()); else if (tag == "palette3") - config.palette[3] = readColor(node); + QColorDialog::setCustomColor(3, readColor(node).rgb()); else if (tag == "palette4") - config.palette[4] = readColor(node); + QColorDialog::setCustomColor(4, readColor(node).rgb()); else if (tag == "palette5") - config.palette[5] = readColor(node); + QColorDialog::setCustomColor(5, readColor(node).rgb()); else if (tag == "palette6") - config.palette[6] = readColor(node); + QColorDialog::setCustomColor(6, readColor(node).rgb()); else if (tag == "palette7") - config.palette[7] = readColor(node); + QColorDialog::setCustomColor(7, readColor(node).rgb()); else if (tag == "palette8") - config.palette[8] = readColor(node); + QColorDialog::setCustomColor(8, readColor(node).rgb()); else if (tag == "palette9") - config.palette[9] = readColor(node); + QColorDialog::setCustomColor(9, readColor(node).rgb()); else if (tag == "palette10") - config.palette[10] = readColor(node); + QColorDialog::setCustomColor(10, readColor(node).rgb()); else if (tag == "palette11") - config.palette[11] = readColor(node); + QColorDialog::setCustomColor(11, readColor(node).rgb()); else if (tag == "palette12") - config.palette[12] = readColor(node); + QColorDialog::setCustomColor(12, readColor(node).rgb()); else if (tag == "palette13") - config.palette[13] = readColor(node); + QColorDialog::setCustomColor(13, readColor(node).rgb()); else if (tag == "palette14") - config.palette[14] = readColor(node); + QColorDialog::setCustomColor(14, readColor(node).rgb()); else if (tag == "palette15") - config.palette[15] = readColor(node); - else if (tag == "palette16") - config.palette[16] = readColor(node); + QColorDialog::setCustomColor(15, readColor(node).rgb()); else if (tag == "selectPartBg") config.selectPartBg = readColor(node); else if (tag == "outputTrackBg") @@ -405,10 +403,10 @@ void MusE::writeGlobalConfiguration(Xml& xml) const sprintf(buffer, "font%d", i); xml.strTag(buffer, config.fonts[i]->toString()); } - for (int i = 0; i < 16; ++i) { + for (int i = 0; i < QColorDialog::customCount(); ++i) { char buffer[32]; - sprintf(buffer, "palette%d", i); - xml.colorTag(buffer, config.palette[i]); + snprintf(buffer, 32, "palette%d", i); + xml.colorTag(buffer, QColorDialog::customColor(i)); } xml.colorTag("selectPartBg", config.selectPartBg); diff --git a/muse/muse/gconfig.cpp b/muse/muse/gconfig.cpp index 7a90489c..414e3348 100644 --- a/muse/muse/gconfig.cpp +++ b/muse/muse/gconfig.cpp @@ -21,24 +21,6 @@ #include "gconfig.h" GlobalConfigValues config = { - { - QColor(0xff, 0xff, 0xff), // palette - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - QColor(0xff, 0xff, 0xff), - }, { QColor(255, 232, 140), // part colors QColor(0xff, 0x00, 0x00), diff --git a/muse/muse/gconfig.h b/muse/muse/gconfig.h index d35ba0f9..137fbcf0 100644 --- a/muse/muse/gconfig.h +++ b/muse/muse/gconfig.h @@ -60,7 +60,6 @@ struct MixerConfig { //--------------------------------------------------------- struct GlobalConfigValues { - QColor palette[16]; QColor partColors[NUM_PARTCOLORS]; QColor selectPartBg; QColor transportHandleColor; diff --git a/muse/muse/preferences.cpp b/muse/muse/preferences.cpp index c509d609..979ef2b1 100644 --- a/muse/muse/preferences.cpp +++ b/muse/muse/preferences.cpp @@ -382,6 +382,18 @@ PreferencesDialog::PreferencesDialog(Arranger* a, QWidget* parent) } +//--------------------------------------------------------- +// setButtonColor +//--------------------------------------------------------- + +static void setButtonColor(QAbstractButton* b, const QRgb c) + { + QPalette p(b->palette()); + p.setColor(QPalette::Button, QColor(c)); + p.setColor(b->backgroundRole(), QColor(c)); + b->setPalette(p); + } + //--------------------------------------------------------- // resetValues //--------------------------------------------------------- @@ -390,39 +402,22 @@ void PreferencesDialog::resetValues() { *config = ::config; // init with global config values updateFonts(); - QPalette p(palette0->palette()); - p.setColor(QPalette::Button, config->palette[0]); - palette0->setPalette(p); - p.setColor(QPalette::Button, config->palette[1]); - palette1->setPalette(p); - p.setColor(QPalette::Button, config->palette[2]); - palette2->setPalette(p); - p.setColor(QPalette::Button, config->palette[3]); - palette3->setPalette(p); - p.setColor(QPalette::Button, config->palette[4]); - palette4->setPalette(p); - p.setColor(QPalette::Button, config->palette[5]); - palette5->setPalette(p); - p.setColor(QPalette::Button, config->palette[6]); - palette6->setPalette(p); - p.setColor(QPalette::Button, config->palette[7]); - palette7->setPalette(p); - p.setColor(QPalette::Button, config->palette[8]); - palette8->setPalette(p); - p.setColor(QPalette::Button, config->palette[9]); - palette9->setPalette(p); - p.setColor(QPalette::Button, config->palette[10]); - palette10->setPalette(p); - p.setColor(QPalette::Button, config->palette[11]); - palette11->setPalette(p); - p.setColor(QPalette::Button, config->palette[12]); - palette12->setPalette(p); - p.setColor(QPalette::Button, config->palette[13]); - palette13->setPalette(p); - p.setColor(QPalette::Button, config->palette[14]); - palette14->setPalette(p); - p.setColor(QPalette::Button, config->palette[15]); - palette15->setPalette(p); + + setButtonColor(palette0, QColorDialog::customColor(0)); + setButtonColor(palette1, QColorDialog::customColor(1)); + setButtonColor(palette2, QColorDialog::customColor(2)); + setButtonColor(palette3, QColorDialog::customColor(3)); + setButtonColor(palette4, QColorDialog::customColor(4)); + setButtonColor(palette5, QColorDialog::customColor(5)); + setButtonColor(palette6, QColorDialog::customColor(6)); + setButtonColor(palette7, QColorDialog::customColor(7)); + setButtonColor(palette8, QColorDialog::customColor(8)); + setButtonColor(palette9, QColorDialog::customColor(9)); + setButtonColor(palette10, QColorDialog::customColor(10)); + setButtonColor(palette11, QColorDialog::customColor(11)); + setButtonColor(palette12, QColorDialog::customColor(12)); + setButtonColor(palette13, QColorDialog::customColor(13)); + setButtonColor(palette14, QColorDialog::customColor(14)); } //--------------------------------------------------------- @@ -836,14 +831,8 @@ void PreferencesDialog::addToPaletteClicked() } if (button) { int id = colorGroup->checkedId(); - config->palette[id] = *color; - QPalette p(button->palette()); - // p.setColor(QPalette::Active, QPalette::Button, *color); - p.setColor(QPalette::Button, *color); - p.setColor(button->backgroundRole(), *color); - - p.setColor(QPalette::Inactive, QPalette::Button, *color); - button->setPalette(p); + QColorDialog::setCustomColor(id, color->rgb()); + setButtonColor(button, color->rgb()); } } @@ -853,6 +842,8 @@ void PreferencesDialog::addToPaletteClicked() void PreferencesDialog::paletteClicked(QAbstractButton* button) { + if (color == 0) + return; QColor c = button->palette().color(QPalette::Button); int r, g, b; c.getRgb(&r, &g, &b); diff --git a/muse/muse/preferences.ui b/muse/muse/preferences.ui index 116fb3e7..a31d9afb 100644 --- a/muse/muse/preferences.ui +++ b/muse/muse/preferences.ui @@ -1,7 +1,4 @@ - - - PreferencesDialogBase @@ -9,7 +6,7 @@ 0 0 731 - 713 + 590 @@ -24,6 +21,9 @@ + + 1 + Application @@ -79,6 +79,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -406,29 +419,67 @@ + + 0 + Arranger - + 9 6 - - - - show snap grid + + + + Parts + + + true + + + 11 + + + 6 + + + + + show names + + + + + + + show events + + + + + + + show Cakewalk Style + + + + - + Events + + true + 11 @@ -488,11 +539,14 @@ - + Background + + true + false @@ -503,34 +557,6 @@ 6 - - - - select... - - - - - - - select... - - - - - - - Color - - - - - - - Pixmap - - - @@ -552,6 +578,13 @@ + + + + Pixmap + + + @@ -562,45 +595,50 @@ - - - - - - - Parts - - - - 11 - - - 6 - - - + + - show names + Color - - + + - show events + select... - - + + - show Cakewalk Style + select... + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + show snap grid + + + @@ -1432,91 +1470,6 @@ 6 - - - - 0 - - - 6 - - - - - S - - - Qt::AlignCenter - - - - - - - 255 - - - Qt::Horizontal - - - - - - - - - 0 - - - 6 - - - - - H - - - Qt::AlignCenter - - - - - - - 255 - - - Qt::Horizontal - - - - - - - - - - 7 - 7 - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - add to palette - - - @@ -1532,8 +1485,21 @@ 6 - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + @@ -1542,8 +1508,8 @@ - - + + @@ -1552,8 +1518,8 @@ - - + + @@ -1562,8 +1528,8 @@ - - + + @@ -1572,8 +1538,8 @@ - - + + @@ -1582,8 +1548,8 @@ - - + + @@ -1592,8 +1558,8 @@ - - + + @@ -1602,8 +1568,8 @@ - - + + @@ -1612,8 +1578,8 @@ - - + + @@ -1622,8 +1588,8 @@ - - + + @@ -1632,8 +1598,8 @@ - - + + @@ -1642,8 +1608,8 @@ - - + + @@ -1652,8 +1618,8 @@ - - + + @@ -1662,8 +1628,8 @@ - - + + @@ -1672,8 +1638,8 @@ - - + + @@ -1682,8 +1648,8 @@ - - + + @@ -1695,6 +1661,36 @@ + + + + 0 + + + 6 + + + + + V + + + Qt::AlignCenter + + + + + + + 255 + + + Qt::Horizontal + + + + + @@ -1715,7 +1711,32 @@ - + + + + add to palette + + + + + + + + 7 + 7 + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + 0 @@ -1724,9 +1745,9 @@ 6 - + - V + H Qt::AlignCenter @@ -1734,7 +1755,37 @@ - + + + 255 + + + Qt::Horizontal + + + + + + + + + 0 + + + 6 + + + + + S + + + Qt::AlignCenter + + + + + 255 @@ -2314,35 +2365,26 @@ - QuantCombo QComboBox
quantcombo.h
- 0 -
RecordButton QToolButton
recordbutton.h
- 0 -
GreendotButton QToolButton
greendotbutton.h
- 0 -
RasterCombo QComboBox
rastercombo.h
- 0 -
-- cgit v1.2.3