summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2010-12-19 06:23:40 +0000
committerTim E. Real <termtech@rogers.com>2010-12-19 06:23:40 +0000
commitcec04808207cf8fae367c4dc07ab672691db2e60 (patch)
treef8032f9260f6d80e9078b4fdb63c5c436c3f72ea
parent5f0c4bf5792d418a1e99a8e992547dd57272e14c (diff)
Fixed not saving part colours and part canvas background appearance settings.
Feature: Added 'global opaqueness' (transparency) appearance setting.
-rw-r--r--muse2/ChangeLog5
-rw-r--r--muse2/muse/appearance.cpp37
-rw-r--r--muse2/muse/appearance.h2
-rw-r--r--muse2/muse/arranger/pcanvas.cpp11
-rw-r--r--muse2/muse/conf.cpp53
-rw-r--r--muse2/muse/gconfig.cpp1
-rw-r--r--muse2/muse/gconfig.h1
-rw-r--r--muse2/muse/widgets/appearancebase.ui128
-rw-r--r--muse2/muse/widgets/musewidgetsplug.cpp1
9 files changed, 199 insertions, 40 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index 498f9062..932ab02f 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,8 @@
+19.12.2010:
+ - Fixed not saving part colours and part canvas background appearance settings. (Tim)
+ *Feature: Added 'global opaqueness' (transparency) appearance setting. (Tim)
+ Currently only affects part colours.
+ TODO: Fix the darn black rectangle drawing. Apply the opaqueness to some other things.
18.12.2010:
- Fixed transport shortcuts not working in some windows or situations. (Tim)
Added event->ignore to PartCanvas::keyPress. Added setFocusPolicy() to WaveView, Master.
diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp
index 0d094a71..08485503 100644
--- a/muse2/muse/appearance.cpp
+++ b/muse2/muse/appearance.cpp
@@ -73,6 +73,8 @@ Appearance::Appearance(Arranger* a, QWidget* parent)
fontName6->setToolTip(tr("Mixer label font. Auto-font-sizing up to chosen font size.\nWord-breaking but only with spaces."));
fontSize6->setToolTip(tr("Maximum mixer label auto-font-sizing font size."));
+ globalAlphaSlider->setToolTip(tr("Global opaqueness (inverse of transparency)."));
+
// ARRANGER
/*
@@ -165,6 +167,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent)
connect(itemList, SIGNAL(itemSelectionChanged()), SLOT(colorItemSelectionChanged()));
connect(aPalette, SIGNAL(buttonClicked(int)), SLOT(paletteClicked(int)));
+ connect(globalAlphaSlider, SIGNAL(valueChanged(int)), SLOT(asliderChanged(int)));
connect(rslider, SIGNAL(valueChanged(int)), SLOT(rsliderChanged(int)));
connect(gslider, SIGNAL(valueChanged(int)), SLOT(gsliderChanged(int)));
connect(bslider, SIGNAL(valueChanged(int)), SLOT(bsliderChanged(int)));
@@ -172,6 +175,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent)
connect(sslider, SIGNAL(valueChanged(int)), SLOT(ssliderChanged(int)));
connect(vslider, SIGNAL(valueChanged(int)), SLOT(vsliderChanged(int)));
+ connect(globalAlphaVal, SIGNAL(valueChanged(int)), SLOT(aValChanged(int)));
connect(rval, SIGNAL(valueChanged(int)), SLOT(rsliderChanged(int)));
connect(gval, SIGNAL(valueChanged(int)), SLOT(gsliderChanged(int)));
connect(bval, SIGNAL(valueChanged(int)), SLOT(bsliderChanged(int)));
@@ -309,6 +313,13 @@ void Appearance::resetValues()
}
}
+ globalAlphaSlider->blockSignals(true);
+ globalAlphaVal->blockSignals(true);
+ globalAlphaSlider->setValue(config->globalAlphaBlend);
+ globalAlphaVal->setValue(config->globalAlphaBlend);
+ globalAlphaSlider->blockSignals(false);
+ globalAlphaVal->blockSignals(false);
+
updateColor();
}
@@ -449,6 +460,8 @@ void Appearance::apply()
config->canvasShowGrid = arrGrid->isChecked();
+ config->globalAlphaBlend = globalAlphaVal->value();
+
// set colors...
::config = *config;
muse->changeConfig(true);
@@ -560,12 +573,14 @@ void Appearance::colorItemSelectionChanged()
void Appearance::updateColor()
{
int r, g, b, h, s, v;
+ //globalAlphaSlider->setEnabled(color);
rslider->setEnabled(color);
gslider->setEnabled(color);
bslider->setEnabled(color);
hslider->setEnabled(color);
sslider->setEnabled(color);
vslider->setEnabled(color);
+ //globalAlphaVal->setEnabled(color);
rval->setEnabled(color);
gval->setEnabled(color);
bval->setEnabled(color);
@@ -575,10 +590,14 @@ void Appearance::updateColor()
if (color == 0)
return;
QPalette pal;
- pal.setColor(colorframe->backgroundRole(), *color);
+ QColor cfc(*color);
+ cfc.setAlpha(globalAlphaVal->value());
+ pal.setColor(colorframe->backgroundRole(), cfc);
colorframe->setPalette(pal);
color->getRgb(&r, &g, &b);
color->getHsv(&h, &s, &v);
+ //a = color->alpha();
+ //a = config->globalAlphaBlend;
rslider->blockSignals(true);
gslider->blockSignals(true);
@@ -620,6 +639,22 @@ void Appearance::updateColor()
vval->blockSignals(false);
}
+void Appearance::asliderChanged(int val)
+ {
+ globalAlphaVal->blockSignals(true);
+ globalAlphaVal->setValue(val);
+ globalAlphaVal->blockSignals(false);
+ updateColor();
+ }
+
+void Appearance::aValChanged(int val)
+ {
+ globalAlphaSlider->blockSignals(true);
+ globalAlphaSlider->setValue(val);
+ globalAlphaSlider->blockSignals(false);
+ updateColor();
+ }
+
void Appearance::rsliderChanged(int val)
{
int r, g, b;
diff --git a/muse2/muse/appearance.h b/muse2/muse/appearance.h
index de0ceb31..daedc2ce 100644
--- a/muse2/muse/appearance.h
+++ b/muse2/muse/appearance.h
@@ -42,6 +42,8 @@ class Appearance : public QDialog, public Ui::AppearanceDialogBase {
void browseFont4();
void browseFont5();
void browseFont6();
+ void asliderChanged(int);
+ void aValChanged(int);
void rsliderChanged(int);
void gsliderChanged(int);
void bsliderChanged(int);
diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp
index 1d7cfd54..d2dda050 100644
--- a/muse2/muse/arranger/pcanvas.cpp
+++ b/muse2/muse/arranger/pcanvas.cpp
@@ -1458,7 +1458,16 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
else {
bool clone = part->events()->arefCount() > 1;
p.setPen(QPen(Qt::black, 2, clone ? Qt::DashLine : Qt::SolidLine));
- p.setBrush(config.partColors[i]);
+
+ //p.setBrush(config.partColors[i]);
+ QColor c(config.partColors[i]);
+ c.setAlpha(config.globalAlphaBlend);
+ p.setBrush(c);
+ //p.setBrush(QColor(config.partColors[i].red(),
+ // config.partColors[i].green(),
+ // config.partColors[i].blue(),
+ // 127));
+
p.drawRect(r);
}
diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp
index 64be7faa..3f7c33e7 100644
--- a/muse2/muse/conf.cpp
+++ b/muse2/muse/conf.cpp
@@ -537,6 +537,8 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
config.fonts[5].fromString(xml.parse1());
else if (tag == "font6")
config.fonts[6].fromString(xml.parse1());
+ else if (tag == "globalAlphaBlend")
+ config.globalAlphaBlend = xml.parseInt();
else if (tag == "palette0")
config.palette[0] = readColor(xml);
else if (tag == "palette1")
@@ -571,6 +573,44 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
config.palette[15] = readColor(xml);
else if (tag == "palette16")
config.palette[16] = readColor(xml);
+ else if (tag == "partColor0")
+ config.partColors[0] = readColor(xml);
+ else if (tag == "partColor1")
+ config.partColors[1] = readColor(xml);
+ else if (tag == "partColor2")
+ config.partColors[2] = readColor(xml);
+ else if (tag == "partColor3")
+ config.partColors[3] = readColor(xml);
+ else if (tag == "partColor4")
+ config.partColors[4] = readColor(xml);
+ else if (tag == "partColor5")
+ config.partColors[5] = readColor(xml);
+ else if (tag == "partColor6")
+ config.partColors[6] = readColor(xml);
+ else if (tag == "partColor7")
+ config.partColors[7] = readColor(xml);
+ else if (tag == "partColor8")
+ config.partColors[8] = readColor(xml);
+ else if (tag == "partColor9")
+ config.partColors[9] = readColor(xml);
+ else if (tag == "partColor10")
+ config.partColors[10] = readColor(xml);
+ else if (tag == "partColor11")
+ config.partColors[11] = readColor(xml);
+ else if (tag == "partColor12")
+ config.partColors[12] = readColor(xml);
+ else if (tag == "partColor13")
+ config.partColors[13] = readColor(xml);
+ else if (tag == "partColor14")
+ config.partColors[14] = readColor(xml);
+ else if (tag == "partColor15")
+ config.partColors[15] = readColor(xml);
+ else if (tag == "partColor16")
+ config.partColors[16] = readColor(xml);
+ else if (tag == "partColor17")
+ config.partColors[17] = readColor(xml);
+ else if (tag == "partCanvasBg")
+ config.partCanvasBg = readColor(xml);
else if (tag == "trackBg")
config.trackBg = readColor(xml);
else if (tag == "selectTrackBg")
@@ -683,6 +723,8 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
config.bigTimeBackgroundColor = readColor(xml);
else if (tag == "transportHandleColor")
config.transportHandleColor = readColor(xml);
+ else if (tag == "waveEditBackgroundColor")
+ config.waveEditBackgroundColor = readColor(xml);
else if (tag == "txDeviceId")
//txDeviceId = xml.parseInt();
xml.parseInt();
@@ -1114,12 +1156,22 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const
sprintf(buffer, "font%d", i);
xml.strTag(level, buffer, config.fonts[i].toString());
}
+
+ xml.intTag(level, "globalAlphaBlend", config.globalAlphaBlend);
+
for (int i = 0; i < 16; ++i) {
char buffer[32];
sprintf(buffer, "palette%d", i);
xml.colorTag(level, buffer, config.palette[i]);
}
+ for (int i = 0; i < NUM_PARTCOLORS; ++i) {
+ char buffer[32];
+ sprintf(buffer, "partColor%d", i);
+ xml.colorTag(level, buffer, config.partColors[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);
@@ -1210,6 +1262,7 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const
xml.colorTag(level, "transportHandleColor", config.transportHandleColor);
xml.colorTag(level, "bigtimeForegroundcolor", config.bigTimeForegroundColor);
xml.colorTag(level, "bigtimeBackgroundcolor", config.bigTimeBackgroundColor);
+ xml.colorTag(level, "waveEditBackgroundColor", config.waveEditBackgroundColor);
writeSeqConfiguration(level, xml, false);
diff --git a/muse2/muse/gconfig.cpp b/muse2/muse/gconfig.cpp
index 00b89374..6c0df0b8 100644
--- a/muse2/muse/gconfig.cpp
+++ b/muse2/muse/gconfig.cpp
@@ -9,6 +9,7 @@
#include "gconfig.h"
GlobalConfigValues config = {
+ 128, // globalAlphaBlend
{
QColor(0xff, 0xff, 0xff), // palette
QColor(0xff, 0xff, 0xff),
diff --git a/muse2/muse/gconfig.h b/muse2/muse/gconfig.h
index 58b223dc..79c66d99 100644
--- a/muse2/muse/gconfig.h
+++ b/muse2/muse/gconfig.h
@@ -48,6 +48,7 @@ struct MixerConfig {
//---------------------------------------------------------
struct GlobalConfigValues {
+ int globalAlphaBlend;
QColor palette[16];
QColor partColors[NUM_PARTCOLORS];
QColor transportHandleColor;
diff --git a/muse2/muse/widgets/appearancebase.ui b/muse2/muse/widgets/appearancebase.ui
index 047f34b9..7a71f90f 100644
--- a/muse2/muse/widgets/appearancebase.ui
+++ b/muse2/muse/widgets/appearancebase.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>591</width>
- <height>597</height>
+ <height>633</height>
</rect>
</property>
<property name="windowTitle">
@@ -22,6 +22,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
<widget class="QWidget" name="tab1">
<attribute name="title">
<string>Arranger</string>
@@ -197,7 +200,7 @@
<attribute name="title">
<string>Colors</string>
</attribute>
- <layout class="QVBoxLayout">
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout">
<item row="0" column="1">
@@ -701,28 +704,77 @@
</item>
<item row="0" column="0" rowspan="3">
<widget class="QTreeWidget" name="itemList">
- <property name="allColumnsShowFocus">
+ <property name="rootIsDecorated">
<bool>true</bool>
</property>
- <property name="rootIsDecorated">
+ <property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Items</string>
</property>
- <property name="clickable">
- <bool>false</bool>
- </property>
- <property name="resizable">
- <bool>false</bool>
- </property>
</column>
</widget>
</item>
</layout>
</item>
<item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="textLabel1_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Global opaqueness</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="globalAlphaVal">
+ <property name="maximum">
+ <number>255</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="globalAlphaSlider">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ <property name="maximum">
+ <number>255</number>
+ </property>
+ <property name="tracking">
+ <bool>true</bool>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::NoTicks</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
<spacer name="botColorSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -834,34 +886,34 @@
</layout>
</item>
<item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="label_41" >
- <property name="text" >
- <string>Style Sheet:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="styleSheetPath" />
- </item>
- <item>
- <widget class="QToolButton" name="openStyleSheet" >
- <property name="text" >
- <string>...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="defaultStyleSheet" >
- <property name="text" >
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QLabel" name="label_41">
+ <property name="text">
+ <string>Style Sheet:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="styleSheetPath"/>
+ </item>
+ <item>
+ <widget class="QToolButton" name="openStyleSheet">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="defaultStyleSheet">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
<spacer name="spacer3">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/muse2/muse/widgets/musewidgetsplug.cpp b/muse2/muse/widgets/musewidgetsplug.cpp
index 4ec8b3a2..577a9c82 100644
--- a/muse2/muse/widgets/musewidgetsplug.cpp
+++ b/muse2/muse/widgets/musewidgetsplug.cpp
@@ -39,6 +39,7 @@ static const char* valu[] = {
};
GlobalConfigValues config = {
+ 128, // globalAlphaBlend
{
QColor(0xff, 0xff, 0xff), // palette
QColor(0xff, 0xff, 0xff),