diff options
32 files changed, 281 insertions, 201 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 949366e9..e7ddcec9 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,9 @@ +30.09.2011: + - Fixed long-standing problem with themes (Ia Ora / Bespin etc) and MusE button icons. Some themes don't support + multiple-pixmap icons. So mute/solo/rec/stereo/thru always showed the same icon. Replaced w single pm icons. (Tim) + - Fixed midi strip blank automation box at bottom, too high. (Tim) + - Gradient for strip labels. (Hm, too pastel? Had to go top-high. Maybe change colours again Orcan, he he...) (Tim) + - Repaired some non-virtual paintEvent(), resizeEvent(), event() etc. (Tim) 28.09.2011: - Optimization: Orcan's meters are insanely lightning-fast now. (Tim) TODO: Fix very slight oversize at bottom upon first showing of mixer. Workaround: Simply resize vertically. diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index b49b951b..b3e89aa1 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -58,7 +58,7 @@ class BgPreviewWidget : public QWidget { int text_w; protected: - void paintEvent(QPaintEvent* event) + virtual void paintEvent(QPaintEvent* event) { QPainter p(this); int w = t_widget->width() - 65; diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index c28a40b2..68f6dceb 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -265,8 +265,11 @@ void TList::paint(const QRect& r) switch (section) { case COL_RECORD: if (track->canRecord() && !header->isSectionHidden(COL_RECORD)) { + //bool aa = p.testRenderHint(QPainter::SmoothPixmapTransform); // Antialiasing); // The rec icon currently looks very jagged. AA should help. + //p.setRenderHint(QPainter::SmoothPixmapTransform); //Antialiasing); drawCenteredPixmap(p, track->recordFlag() ? record_on_Icon : record_off_Icon, r); + //p.setRenderHint(QPainter::SmoothPixmapTransform, aa); //Antialiasing, aa); } break; case COL_CLASS: @@ -1689,10 +1692,10 @@ void TList::setYPos(int y) // resizeEvent //--------------------------------------------------------- -void TList::resizeEvent(QResizeEvent* /*ev*/) - { - - } +//void TList::resizeEvent(QResizeEvent* /*ev*/) +// { +// +// } //--------------------------------------------------------- // classesPopupMenu diff --git a/muse2/muse/arranger/tlist.h b/muse2/muse/arranger/tlist.h index 01b13eb3..db19ef6b 100644 --- a/muse2/muse/arranger/tlist.h +++ b/muse2/muse/arranger/tlist.h @@ -103,7 +103,7 @@ class TList : public QWidget { void moveSelection(int n); void adjustScrollbar(); void paint(const QRect& r); - virtual void resizeEvent(QResizeEvent*); + //virtual void resizeEvent(QResizeEvent*); void redraw(const QRect& r); Track* y2Track(int) const; void classesPopupMenu(Track*, int x, int y); diff --git a/muse2/muse/arranger/trackautomationview.h b/muse2/muse/arranger/trackautomationview.h index f169e968..8c7aed84 100644 --- a/muse2/muse/arranger/trackautomationview.h +++ b/muse2/muse/arranger/trackautomationview.h @@ -33,7 +33,7 @@ namespace MusEArranger { class TrackAutomationView : public QWidget { Track *_t; - void paintEvent(QPaintEvent *e); + virtual void paintEvent(QPaintEvent *e); std::map<int,int> automationList; public: TrackAutomationView(QWidget *parent, Track *t); diff --git a/muse2/muse/icons.cpp b/muse2/muse/icons.cpp index 423e65fa..89a3a48e 100644 --- a/muse2/muse/icons.cpp +++ b/muse2/muse/icons.cpp @@ -367,8 +367,8 @@ QPixmap* soloIconOn; QPixmap* soloIconOff; QPixmap* soloblksqIconOn; QPixmap* soloblksqIconOff; -QIcon* soloIconSet1; -QIcon* soloIconSet2; +//QIcon* soloIconSet1; +//QIcon* soloIconSet2; QPixmap* editmuteIcon; QPixmap* editmuteSIcon; @@ -582,8 +582,12 @@ void initIcons() editpaste2TrackIcon = new MICON(editpaste2track_xpm, NULL); editpasteClone2TrackIcon = new MICON(editpasteclone2track_xpm, NULL); */ - exitIcon = new MPIXMAP(exit_xpm, "application-exit"); - exit1Icon = new MPIXMAP(exit1_xpm, "application-exit"); + + //exitIcon = new MPIXMAP(exit_xpm, "application-exit"); + //exit1Icon = new MPIXMAP(exit1_xpm, "application-exit"); + // Changed by Tim. There are IMO no suitable theme substitutes for these two so far... + exitIcon = new MPIXMAP(exit_xpm, NULL); + exit1Icon = new MPIXMAP(exit1_xpm, NULL); // 2 lines odd code newmuteIcon = new MPIXMAP(newmutebutton_xpm, NULL); @@ -597,12 +601,12 @@ void initIcons() soloIconOff = new MPIXMAP(solobutton_off_xpm, NULL); soloblksqIconOn = new MPIXMAP(solobutton_on_blksq_xpm, NULL); soloblksqIconOff = new MPIXMAP(solobutton_off_blksq_xpm, NULL); - soloIconSet1 = new QIcon(); - soloIconSet2 = new QIcon(); - soloIconSet1->addPixmap(*soloIconOn, QIcon::Normal, QIcon::On); - soloIconSet1->addPixmap(*soloIconOff, QIcon::Normal, QIcon::Off); - soloIconSet2->addPixmap(*soloblksqIconOn, QIcon::Normal, QIcon::On); - soloIconSet2->addPixmap(*soloblksqIconOff, QIcon::Normal, QIcon::Off); + //soloIconSet1 = new QIcon(); + //soloIconSet2 = new QIcon(); + //soloIconSet1->addPixmap(*soloIconOn, QIcon::Normal, QIcon::On); + //soloIconSet1->addPixmap(*soloIconOff, QIcon::Normal, QIcon::Off); + //soloIconSet2->addPixmap(*soloblksqIconOn, QIcon::Normal, QIcon::On); + //soloIconSet2->addPixmap(*soloblksqIconOff, QIcon::Normal, QIcon::Off); redLedIcon = new MPIXMAP(redled_xpm, NULL); darkRedLedIcon = new MPIXMAP(darkredled_xpm, NULL); diff --git a/muse2/muse/icons.h b/muse2/muse/icons.h index 8d55b255..957f4a74 100644 --- a/muse2/muse/icons.h +++ b/muse2/muse/icons.h @@ -151,8 +151,8 @@ extern QPixmap* soloIconOn; extern QPixmap* soloIconOff; extern QPixmap* soloblksqIconOn; extern QPixmap* soloblksqIconOff; -extern QIcon* soloIconSet1; -extern QIcon* soloIconSet2; +//extern QIcon* soloIconSet1; +//extern QIcon* soloIconSet2; extern QPixmap* redLedIcon; extern QPixmap* darkRedLedIcon; diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp index 156017e8..bf31d820 100644 --- a/muse2/muse/mixer/astrip.cpp +++ b/muse2/muse/mixer/astrip.cpp @@ -4,6 +4,7 @@ // $Id: astrip.cpp,v 1.23.2.17 2009/11/16 01:55:55 terminator356 Exp $ // // (C) Copyright 2000-2004 Werner Schweer (ws@seh.de) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -172,28 +173,19 @@ void AudioStrip::songChanged(int val) mute->blockSignals(true); mute->setChecked(src->mute()); mute->blockSignals(false); + mute->setIcon(src->mute() ? QIcon(*muteIconOff) : QIcon(*muteIconOn)); + //mute->setIconSize(muteIconOn->size()); updateOffState(); } if (solo && (val & SC_SOLO)) { - if((bool)track->internalSolo()) - { - if(!useSoloIconSet2) - { - solo->setIcon(*soloIconSet2); - solo->setIconSize(soloIconOn->size()); - useSoloIconSet2 = true; - } - } - else if(useSoloIconSet2) - { - solo->setIcon(*soloIconSet1); - solo->setIconSize(soloblksqIconOn->size()); - useSoloIconSet2 = false; - } - solo->blockSignals(true); solo->setChecked(track->solo()); solo->blockSignals(false); + if(track->internalSolo()) + solo->setIcon(track->solo() ? QIcon(*soloblksqIconOn) : QIcon(*soloblksqIconOff)); + else + solo->setIcon(track->solo() ? QIcon(*soloIconOn) : QIcon(*soloIconOff)); + //solo->setIconSize(soloIconOn->size()); } if (val & SC_RECFLAG) setRecordFlag(track->recordFlag()); @@ -232,19 +224,31 @@ void AudioStrip::songChanged(int val) if(track->automationType() == AUTO_TOUCH || track->automationType() == AUTO_WRITE) { palette.setColor(QPalette::Button, QColor(215, 76, 39)); // red - //QColor c(Qt::red); - //gradient.setColorAt(0, c); - //gradient.setColorAt(1, c.darker()); - //palette.setBrush(QPalette::Button, gradient); + //palette.setColor(QPalette::Window, QColor(215, 76, 39)); // red + /*QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft()); + QColor c(Qt::red); + //QColor c(215, 76, 39); // red + gradient.setColorAt(0, c.darker()); + gradient.setColorAt(0.5, c); + gradient.setColorAt(1, c.darker()); + palette.setBrush(QPalette::Button, gradient); + //palette.setBrush(autoType->backgroundRole(), gradient); + //palette.setBrush(QPalette::Window, gradient); */ autoType->setPalette(palette); } else if(track->automationType() == AUTO_READ) { palette.setColor(QPalette::Button, QColor(100, 172, 49)); // green - //QColor c(Qt::green); - //gradient.setColorAt(0, c); - //gradient.setColorAt(1, c.darker()); - //palette.setBrush(QPalette::Button, gradient); + //palette.setColor(QPalette::Window, QColor(100, 172, 49)); // green + /*QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft()); + QColor c(Qt::green); + //QColor c(100, 172, 49); // green + gradient.setColorAt(0, c.darker()); + gradient.setColorAt(0.5, c); + gradient.setColorAt(1, c.darker()); + palette.setBrush(QPalette::Button, gradient); + //palette.setBrush(autoType->backgroundRole(), gradient); + //palette.setBrush(QPalette::Window, gradient); */ autoType->setPalette(palette); } else @@ -354,6 +358,8 @@ void AudioStrip::updateOffState() off->blockSignals(true); off->setChecked(track->off()); off->blockSignals(false); + off->setIcon(track->off() ? QIcon(*exit1Icon) : QIcon(*exitIcon)); + //off->setIconSize(exit1Icon->size()); } } @@ -623,6 +629,8 @@ void AudioStrip::updateChannels() stereo->blockSignals(true); stereo->setChecked(channel == 2); stereo->blockSignals(false); + stereo->setIcon(channel == 2 ? QIcon(*stereoIcon) : QIcon(*monoIcon)); + //stereo->setIconSize(stereoIcon->size()); } //--------------------------------------------------------- @@ -753,15 +761,11 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) stereo = new QToolButton(); stereo->setFont(MusEConfig::config.fonts[1]); - QIcon stereoSet; - stereoSet.addPixmap(*monoIcon, QIcon::Normal, QIcon::Off); - stereoSet.addPixmap(*stereoIcon, QIcon::Normal, QIcon::On); - stereo->setIcon(stereoSet); - stereo->setIconSize(monoIcon->size()); - stereo->setCheckable(true); stereo->setToolTip(tr("1/2 channel")); stereo->setChecked(channel == 2); + stereo->setIcon(channel == 2 ? QIcon(*stereoIcon) : QIcon(*monoIcon)); + stereo->setIconSize(monoIcon->size()); stereo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); connect(stereo, SIGNAL(clicked(bool)), SLOT(stereoToggled(bool))); @@ -868,47 +872,33 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) record->setCheckable(true); record->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); record->setBackgroundRole(QPalette::Mid); - QIcon iconSet; - iconSet.addPixmap(*record_on_Icon, QIcon::Normal, QIcon::On); - iconSet.addPixmap(*record_off_Icon, QIcon::Normal, QIcon::Off); - record->setIcon(iconSet); - record->setIconSize(record_on_Icon->size()); record->setToolTip(tr("record")); record->setChecked(t->recordFlag()); + record->setIcon(t->recordFlag() ? QIcon(*record_on_Icon) : QIcon(*record_off_Icon)); + record->setIconSize(record_on_Icon->size()); connect(record, SIGNAL(clicked(bool)), SLOT(recordToggled(bool))); } Track::TrackType type = t->type(); mute = new QToolButton(); - QIcon muteSet; - muteSet.addPixmap(*muteIconOn, QIcon::Normal, QIcon::Off); - muteSet.addPixmap(*muteIconOff, QIcon::Normal, QIcon::On); - mute->setIcon(muteSet); - mute->setIconSize(muteIconOn->size()); mute->setCheckable(true); mute->setToolTip(tr("mute")); mute->setChecked(t->mute()); + mute->setIcon(t->mute() ? QIcon(*muteIconOff) : QIcon(*muteIconOn)); + mute->setIconSize(muteIconOn->size()); mute->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); connect(mute, SIGNAL(clicked(bool)), SLOT(muteToggled(bool))); solo = new QToolButton(); - if((bool)t->internalSolo()) - { - solo->setIcon(*soloIconSet2); - solo->setIconSize(soloIconOn->size()); - useSoloIconSet2 = true; - } - else - { - solo->setIcon(*soloIconSet1); - solo->setIconSize(soloblksqIconOn->size()); - useSoloIconSet2 = false; - } - solo->setCheckable(true); solo->setChecked(t->solo()); + if(t->internalSolo()) + solo->setIcon(t->solo() ? QIcon(*soloblksqIconOn) : QIcon(*soloblksqIconOff)); + else + solo->setIcon(t->solo() ? QIcon(*soloIconOn) : QIcon(*soloIconOff)); + solo->setIconSize(soloIconOn->size()); solo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); connect(solo, SIGNAL(clicked(bool)), SLOT(soloToggled(bool))); if (type == Track::AUDIO_OUTPUT) { @@ -922,16 +912,13 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) } off = new MusEWidget::TransparentToolButton(this); - QIcon iconSet; - iconSet.addPixmap(*exit1Icon, QIcon::Normal, QIcon::On); - iconSet.addPixmap(*exitIcon, QIcon::Normal, QIcon::Off); - off->setIcon(iconSet); - off->setIconSize(exit1Icon->size()); off->setBackgroundRole(QPalette::Mid); off->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); off->setCheckable(true); off->setToolTip(tr("off")); off->setChecked(t->off()); + off->setIcon(t->off() ? QIcon(*exit1Icon) : QIcon(*exitIcon)); + off->setIconSize(exit1Icon->size()); connect(off, SIGNAL(clicked(bool)), SLOT(offToggled(bool))); grid->addWidget(off, _curGridRow, 0); @@ -972,6 +959,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) autoType = new MusEWidget::ComboBox(); autoType->setFont(MusEConfig::config.fonts[1]); autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); + //autoType->setAutoFillBackground(true); autoType->addAction(tr("Off"), AUTO_OFF); autoType->addAction(tr("Read"), AUTO_READ); @@ -983,20 +971,30 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) //QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft()); if(t->automationType() == AUTO_TOUCH || t->automationType() == AUTO_WRITE) { - palette.setColor(QPalette::Button, QColor(Qt::red)); - //QColor c(Qt::red); - //gradient.setColorAt(0, c); - //gradient.setColorAt(1, c.darker()); - //palette.setBrush(QPalette::Button, gradient); + palette.setColor(QPalette::Button, QColor(215, 76, 39)); // red + /* QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft()); + QColor c(Qt::red); + //QColor c(215, 76, 39); // red + gradient.setColorAt(0, c.darker()); + gradient.setColorAt(0.5, c); + gradient.setColorAt(1, c.darker()); + palette.setBrush(QPalette::Button, gradient); + //palette.setBrush(autoType->backgroundRole(), gradient); + //palette.setBrush(QPalette::Window, gradient); */ autoType->setPalette(palette); } else if(t->automationType() == AUTO_READ) { - palette.setColor(QPalette::Button, QColor(Qt::green)); - //QColor c(Qt::green); - //gradient.setColorAt(0, c); - //gradient.setColorAt(1, c.darker()); - //palette.setBrush(QPalette::Button, gradient); + palette.setColor(QPalette::Button, QColor(100, 172, 49)); // green + /*QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft()); + QColor c(Qt::green); + //QColor c(100, 172, 49); // green + gradient.setColorAt(0, c.darker()); + gradient.setColorAt(0.5, c); + gradient.setColorAt(1, c.darker()); + palette.setBrush(QPalette::Button, gradient); + //palette.setBrush(autoType->backgroundRole(), gradient); + //palette.setBrush(QPalette::Window, gradient); */ autoType->setPalette(palette); } else diff --git a/muse2/muse/mixer/astrip.h b/muse2/muse/mixer/astrip.h index 72e88cca..3e2b6c1d 100644 --- a/muse2/muse/mixer/astrip.h +++ b/muse2/muse/mixer/astrip.h @@ -4,6 +4,7 @@ // $Id: astrip.h,v 1.8.2.6 2009/11/14 03:37:48 terminator356 Exp $ // // (C) Copyright 2000-2004 Werner Schweer (ws@seh.de) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/muse2/muse/mixer/mstrip.cpp b/muse2/muse/mixer/mstrip.cpp index c6832e6b..c920d6c6 100644 --- a/muse2/muse/mixer/mstrip.cpp +++ b/muse2/muse/mixer/mstrip.cpp @@ -4,6 +4,7 @@ // $Id: mstrip.cpp,v 1.9.2.13 2009/11/14 03:37:48 terminator356 Exp $ // // (C) Copyright 2000-2004 Werner Schweer (ws@seh.de) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -296,48 +297,32 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) record->setBackgroundRole(QPalette::Mid); record->setCheckable(true); record->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); - - QIcon iconSet; - iconSet.addPixmap(*record_on_Icon, QIcon::Normal, QIcon::On); - iconSet.addPixmap(*record_off_Icon, QIcon::Normal, QIcon::Off); - record->setIcon(iconSet); - record->setIconSize(record_on_Icon->size()); record->setToolTip(tr("record")); record->setChecked(track->recordFlag()); + record->setIcon(track->recordFlag() ? QIcon(*record_on_Icon) : QIcon(*record_off_Icon)); + record->setIconSize(record_on_Icon->size()); connect(record, SIGNAL(clicked(bool)), SLOT(recordToggled(bool))); mute = new QToolButton(); - QIcon muteSet; - muteSet.addPixmap(*muteIconOn, QIcon::Normal, QIcon::Off); - muteSet.addPixmap(*muteIconOff, QIcon::Normal, QIcon::On); - mute->setIcon(muteSet); - mute->setIconSize(muteIconOn->size()); mute->setCheckable(true); mute->setToolTip(tr("mute")); mute->setChecked(track->mute()); + mute->setIcon(track->mute() ? QIcon(*muteIconOff) : QIcon(*muteIconOn)); + mute->setIconSize(muteIconOn->size()); mute->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); connect(mute, SIGNAL(clicked(bool)), SLOT(muteToggled(bool))); solo = new QToolButton(); - - if((bool)t->internalSolo()) - { - solo->setIcon(*soloIconSet2); - solo->setIconSize(soloIconOn->size()); - useSoloIconSet2 = true; - } - else - { - solo->setIcon(*soloIconSet1); - solo->setIconSize(soloblksqIconOn->size()); - useSoloIconSet2 = false; - } - //solo->setToolTip(tr("pre fader listening")); solo->setToolTip(tr("solo mode")); solo->setCheckable(true); - solo->setChecked(t->solo()); + solo->setChecked(track->solo()); solo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); + if(track->internalSolo()) + solo->setIcon(track->solo() ? QIcon(*soloblksqIconOn) : QIcon(*soloblksqIconOff)); + else + solo->setIcon(track->solo() ? QIcon(*soloIconOn) : QIcon(*soloIconOff)); + solo->setIconSize(soloIconOn->size()); connect(solo, SIGNAL(clicked(bool)), SLOT(soloToggled(bool))); /* @@ -363,8 +348,8 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) ///dev_ch_label->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum)); dev_ch_label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); dev_ch_label->setAlignment(Qt::AlignCenter); - int port = t->outPort(); - int channel = t->outChannel(); + int port = track->outPort(); + int channel = track->outChannel(); QString dcs; dcs.sprintf("%d-%d", port + 1, channel + 1); dev_ch_label->setText(dcs); @@ -377,16 +362,13 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) */ off = new MusEWidget::TransparentToolButton(this); - QIcon iconOff; - iconOff.addPixmap(*exit1Icon, QIcon::Normal, QIcon::On); - iconOff.addPixmap(*exitIcon, QIcon::Normal, QIcon::Off); - off->setIcon(iconOff); - off->setIconSize(exit1Icon->size()); off->setBackgroundRole(QPalette::Mid); off->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); off->setCheckable(true); off->setToolTip(tr("off")); - off->setChecked(t->off()); + off->setChecked(track->off()); + off->setIcon(track->off() ? QIcon(*exit1Icon) : QIcon(*exitIcon)); + off->setIconSize(exit1Icon->size()); connect(off, SIGNAL(clicked(bool)), SLOT(offToggled(bool))); grid->addWidget(off, _curGridRow, 0); @@ -436,6 +418,8 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) //autoType->setCurrentItem(t->automationType()); //autoType->setToolTip(tr("automation type")); //connect(autoType, SIGNAL(activated(int)), SLOT(setAutomationType(int))); + autoType->addAction(" ", AUTO_OFF); // Just a dummy text to fix sizing problems. REMOVE later if full automation added. + autoType->setCurrentItem(AUTO_OFF); // grid->addWidget(autoType, _curGridRow++, 0, 1, 2); connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat())); @@ -461,8 +445,9 @@ void MidiStrip::updateOffState() solo->setEnabled(val); if (mute) mute->setEnabled(val); - if (autoType) - autoType->setEnabled(val); + // TODO: Disabled for now. + //if (autoType) + // autoType->setEnabled(val); if (iR) iR->setEnabled(val); // TODO: Disabled for now. @@ -472,6 +457,8 @@ void MidiStrip::updateOffState() off->blockSignals(true); off->setChecked(track->off()); off->blockSignals(false); + off->setIcon(track->off() ? QIcon(*exit1Icon) : QIcon(*exitIcon)); + //off->setIconSize(exit1Icon->size()); } } @@ -483,30 +470,23 @@ void MidiStrip::songChanged(int val) { if (mute && (val & SC_MUTE)) { // mute && off mute->blockSignals(true); - mute->setChecked(track->isMute()); - updateOffState(); + //mute->setChecked(track->isMute()); + mute->setChecked(track->mute()); mute->blockSignals(false); + mute->setIcon(track->mute() ? QIcon(*muteIconOff) : QIcon(*muteIconOn)); + //mute->setIconSize(muteIconOn->size()); + updateOffState(); } if (solo && (val & SC_SOLO)) { - if((bool)track->internalSolo()) - { - if(!useSoloIconSet2) - { - solo->setIcon(*soloIconSet2); - solo->setIconSize(soloIconOn->size()); - useSoloIconSet2 = true; - } - } - else if(useSoloIconSet2) - { - solo->setIcon(*soloIconSet1); - solo->setIconSize(soloblksqIconOn->size()); - useSoloIconSet2 = false; - } solo->blockSignals(true); solo->setChecked(track->solo()); solo->blockSignals(false); + if(track->internalSolo()) + solo->setIcon(track->solo() ? QIcon(*soloblksqIconOn) : QIcon(*soloblksqIconOff)); + else + solo->setIcon(track->solo() ? QIcon(*soloIconOn) : QIcon(*soloIconOff)); + //solo->setIconSize(soloIconOn->size()); } if (val & SC_RECFLAG) diff --git a/muse2/muse/mixer/mstrip.h b/muse2/muse/mixer/mstrip.h index d8e947f9..0535eaa8 100644 --- a/muse2/muse/mixer/mstrip.h +++ b/muse2/muse/mixer/mstrip.h @@ -4,6 +4,7 @@ // $Id: mstrip.h,v 1.4.2.4 2009/10/25 19:26:29 lunar_shuttle Exp $ // // (C) Copyright 2000-2004 Werner Schweer (ws@seh.de) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp index e9f92e9b..59149222 100644 --- a/muse2/muse/mixer/strip.cpp +++ b/muse2/muse/mixer/strip.cpp @@ -4,6 +4,7 @@ // $Id: strip.cpp,v 1.6.2.5 2009/11/14 03:37:48 terminator356 Exp $ // // (C) Copyright 2000-2004 Werner Schweer (ws@seh.de) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -38,6 +39,7 @@ #include "strip.h" #include "meter.h" #include "utils.h" +#include "icons.h" namespace MusEMixer { @@ -51,6 +53,8 @@ void Strip::setRecordFlag(bool flag) record->blockSignals(true); record->setChecked(flag); record->blockSignals(false); + record->setIcon(flag ? QIcon(*record_on_Icon) : QIcon(*record_off_Icon)); + //record->setIconSize(record_on_Icon->size()); } } @@ -75,7 +79,11 @@ void Strip::recordToggled(bool val) } audio->msgSetRecord((AudioOutput*)track, val); if (!((AudioOutput*)track)->recFile()) + { record->setChecked(false); + record->setIcon(QIcon(*record_off_Icon)); + //record->setIconSize(record_on_Icon->size()); + } return; } song->setRecordFlag(track, val); @@ -148,8 +156,18 @@ void Strip::setLabelText() label->setText(track->name()); QPalette palette; - palette.setColor(label->backgroundRole(), c); + //palette.setColor(label->backgroundRole(), c); + QLinearGradient gradient(label->geometry().topLeft(), label->geometry().bottomLeft()); + //gradient.setColorAt(0, c.darker()); + //gradient.setColorAt(0, c); + //gradient.setColorAt(1, c.darker()); + gradient.setColorAt(0, c.lighter()); + gradient.setColorAt(1, c); + //palette.setBrush(QPalette::Button, gradient); + //palette.setBrush(QPalette::Window, gradient); + palette.setBrush(label->backgroundRole(), gradient); label->setPalette(palette); + //label->setStyleSheet(QString("background-color: ") + c.name()); } @@ -186,18 +204,16 @@ Strip::Strip(QWidget* parent, Track* t) iR = 0; oR = 0; - setBackgroundRole(QPalette::Mid); + ///setBackgroundRole(QPalette::Mid); setFrameStyle(Panel | Raised); setLineWidth(2); // NOTE: Workaround for freakin' improper disabled button text colour (at least with Oxygen colours). // Just set the parent palette. - QPalette pal(palette()); - pal.setColor(QPalette::Disabled, QPalette::ButtonText, - pal.color(QPalette::Disabled, QPalette::WindowText)); - setPalette(pal); - - useSoloIconSet2 = false; + //QPalette pal(palette()); + //pal.setColor(QPalette::Disabled, QPalette::ButtonText, + // pal.color(QPalette::Disabled, QPalette::WindowText)); + //setPalette(pal); track = t; meter[0] = 0; @@ -233,7 +249,7 @@ Strip::Strip(QWidget* parent, Track* t) // Therefore 'fake' set the size of the label now. // Added by Tim. p3.3.9 //label->setGeometry(label->x(), label->y(), STRIP_WIDTH - 2*frameWidth() - 2*layout->margin(), label->height()); - label->setGeometry(label->x(), label->y(), STRIP_WIDTH - 2*grid->margin(), label->height()); + ///label->setGeometry(label->x(), label->y(), STRIP_WIDTH - 2*grid->margin(), label->height()); label->setTextFormat(Qt::PlainText); @@ -279,5 +295,14 @@ void Strip::setAutomationType(int t) track->setAutomationType(AutomationType(t)); song->update(SC_AUTOMATION); } + +void Strip::resizeEvent(QResizeEvent* ev) +{ + //printf("Strip::resizeEvent\n"); + QFrame::resizeEvent(ev); + setLabelText(); + setLabelFont(); +} + } // namespace MusEMixer diff --git a/muse2/muse/mixer/strip.h b/muse2/muse/mixer/strip.h index ea4d2693..f5749177 100644 --- a/muse2/muse/mixer/strip.h +++ b/muse2/muse/mixer/strip.h @@ -4,6 +4,7 @@ // $Id: strip.h,v 1.3.2.2 2009/11/14 03:37:48 terminator356 Exp $ // // (C) Copyright 2000-2004 Werner Schweer (ws@seh.de) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -62,7 +63,6 @@ class Strip : public QFrame { QGridLayout* grid; int _curGridRow; MusEWidget::Meter* meter[MAX_CHANNELS]; - bool useSoloIconSet2; QToolButton* record; QToolButton* solo; @@ -72,6 +72,7 @@ class Strip : public QFrame { QGridLayout* sliderGrid; MusEWidget::ComboBox* autoType; void setLabelText(); + virtual void resizeEvent(QResizeEvent*); private slots: void recordToggled(bool); diff --git a/muse2/muse/widgets/bigtime.cpp b/muse2/muse/widgets/bigtime.cpp index 572710e2..f4162041 100644 --- a/muse2/muse/widgets/bigtime.cpp +++ b/muse2/muse/widgets/bigtime.cpp @@ -334,6 +334,7 @@ void BigTime::setPos(int idx, unsigned v, bool) void BigTime::resizeEvent(QResizeEvent *ev) { + QWidget::resizeEvent(ev); dwin->resize(ev->size()); QFont f = dwin->font(); QFontMetrics fm(f); diff --git a/muse2/muse/widgets/knob.cpp b/muse2/muse/widgets/knob.cpp index 9bc63b33..ac035065 100644 --- a/muse2/muse/widgets/knob.cpp +++ b/muse2/muse/widgets/knob.cpp @@ -327,8 +327,9 @@ void Knob::rangeChange() // resizeEvent //--------------------------------------------------------- -void Knob::resizeEvent(QResizeEvent *) +void Knob::resizeEvent(QResizeEvent* ev) { + MusEWidget::SliderBase::resizeEvent(ev); int width, width_2; const QRect& r = rect(); diff --git a/muse2/muse/widgets/knob.h b/muse2/muse/widgets/knob.h index a629f158..257ff0c7 100644 --- a/muse2/muse/widgets/knob.h +++ b/muse2/muse/widgets/knob.h @@ -78,8 +78,8 @@ class Knob : public SliderBase, public ScaleIf void drawKnob(QPainter *p, const QRect &r); void drawMarker(QPainter *p, double arc, const QColor &c); - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *e); + virtual void paintEvent(QPaintEvent *); + virtual void resizeEvent(QResizeEvent *e); double getValue(const QPoint &p); void getScrollMode( QPoint &p, const Qt::MouseButton &button, int &scrollMode, int &direction ); void scaleChange() { repaint(); } diff --git a/muse2/muse/widgets/meter.cpp b/muse2/muse/widgets/meter.cpp index 789089fe..590e7f65 100644 --- a/muse2/muse/widgets/meter.cpp +++ b/muse2/muse/widgets/meter.cpp @@ -532,8 +532,9 @@ void Meter::drawVU(QPainter& p, const QRect& rect, const QPainterPath& drawPath, // resizeEvent //--------------------------------------------------------- -void Meter::resizeEvent(QResizeEvent* /*ev*/) +void Meter::resizeEvent(QResizeEvent* ev) { + QFrame::resizeEvent(ev); cur_yv = -1; // Force re-initialization. } diff --git a/muse2/muse/widgets/meter.h b/muse2/muse/widgets/meter.h index 7b5369b6..1de3841f 100644 --- a/muse2/muse/widgets/meter.h +++ b/muse2/muse/widgets/meter.h @@ -75,6 +75,10 @@ class Meter : public QFrame { QColor separator_color;; QColor peak_color; int xrad, yrad; + + virtual void resizeEvent(QResizeEvent*); + virtual void paintEvent(QPaintEvent*); + virtual void mousePressEvent(QMouseEvent*); private: MeterType mtype; @@ -87,10 +91,6 @@ class Meter : public QFrame { void drawVU(QPainter& p, const QRect&, const QPainterPath&, int); - void paintEvent(QPaintEvent*); - void resizeEvent(QResizeEvent*); - void mousePressEvent(QMouseEvent*); - public slots: void resetPeaks(); void setVal(double, double, bool); diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp index e4c4e217..56429879 100644 --- a/muse2/muse/widgets/mtrackinfo.cpp +++ b/muse2/muse/widgets/mtrackinfo.cpp @@ -2,6 +2,7 @@ // MusE // Linux Music Editor // (C) Copyright 2010 Werner Schweer and others (ws@seh.de) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -21,6 +22,9 @@ #include <QTimer> #include <QMessageBox> +#include <QLinearGradient> +#include <QPalette> +#include <QColor> #include <math.h> #include <string.h> @@ -60,8 +64,10 @@ void MidiTrackInfo::setTrack(Track* t) if(!t->isMidiTrack()) return; selected = t; + + trackNameLabel->setObjectName(selected->cname()); - QPalette pal; + /*QPalette pal; if(selected->type() == Track::DRUM) { pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.drumTrackLabelBg); iOutputChannel->setEnabled(false); @@ -69,7 +75,8 @@ void MidiTrackInfo::setTrack(Track* t) pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.midiTrackLabelBg); iOutputChannel->setEnabled(true); } - trackNameLabel->setPalette(pal); + trackNameLabel->setPalette(pal); */ + //setLabelText(); updateTrackInfo(-1); } @@ -97,10 +104,7 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent //iChanDetectLabel->setPixmap(*darkgreendotIcon); iChanDetectLabel->setPixmap(*darkRedLedIcon); - QIcon recEchoIconSet; - recEchoIconSet.addPixmap(*midiThruOnIcon, QIcon::Normal, QIcon::On); - recEchoIconSet.addPixmap(*midiThruOffIcon, QIcon::Normal, QIcon::Off); - recEchoButton->setIcon(recEchoIconSet); + recEchoButton->setIcon((selected && ((MidiTrack*)selected)->recEcho()) ? QIcon(*midiThruOnIcon) : QIcon(*midiThruOffIcon)); 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. @@ -114,14 +118,26 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent if(selected) { trackNameLabel->setObjectName(selected->cname()); - QPalette pal; + + /*QPalette pal; + QColor c; //pal.setColor(trackNameLabel->backgroundRole(), QColor(0, 160, 255)); // Med blue if(selected->type() == Track::DRUM) - pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.drumTrackLabelBg); + c = MusEConfig::config.drumTrackLabelBg; else - pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.midiTrackLabelBg); - trackNameLabel->setPalette(pal); - } + c = MusEConfig::config.midiTrackLabelBg; + + QLinearGradient gradient(trackNameLabel->geometry().topLeft(), trackNameLabel->geometry().bottomLeft()); + //gradient.setColorAt(0, c.darker()); + //gradient.setColorAt(0, c); + //gradient.setColorAt(1, c.darker()); + gradient.setColorAt(0, c.lighter()); + gradient.setColorAt(1, c); + //palette.setBrush(QPalette::Button, gradient); + //palette.setBrush(QPalette::Window, gradient); + pal.setBrush(trackNameLabel->backgroundRole(), gradient); + trackNameLabel->setPalette(pal); */ + } //else //{ // pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.midiTrackLabelBg); @@ -543,6 +559,28 @@ void MidiTrackInfo::setLabelText() trackNameLabel->setText(track->name()); else trackNameLabel->setText(QString()); + + if(track) + { + QPalette pal; + QColor c; + //pal.setColor(trackNameLabel->backgroundRole(), QColor(0, 160, 255)); // Med blue + if(track->type() == Track::DRUM) + c = MusEConfig::config.drumTrackLabelBg; + else + c = MusEConfig::config.midiTrackLabelBg; + + QLinearGradient gradient(trackNameLabel->geometry().topLeft(), trackNameLabel->geometry().bottomLeft()); + //gradient.setColorAt(0, c.darker()); + //gradient.setColorAt(0, c); + //gradient.setColorAt(1, c.darker()); + gradient.setColorAt(0, c.lighter()); + gradient.setColorAt(1, c); + //palette.setBrush(QPalette::Button, gradient); + //palette.setBrush(QPalette::Window, gradient); + pal.setBrush(trackNameLabel->backgroundRole(), gradient); + trackNameLabel->setPalette(pal); + } } //--------------------------------------------------------- @@ -1340,6 +1378,8 @@ void MidiTrackInfo::updateTrackInfo(int flags) recEchoButton->setChecked(track->recEcho()); recEchoButton->blockSignals(false); } + recEchoButton->setIcon(track->recEcho() ? QIcon(*midiThruOnIcon) : QIcon(*midiThruOffIcon)); + //recEchoButton->setIconSize(midiThruOnIcon->size()); } int outChannel = track->outChannel(); @@ -1566,4 +1606,12 @@ void MidiTrackInfo::recordClicked() } } +void MidiTrackInfo::resizeEvent(QResizeEvent* ev) +{ + //printf("MidiTrackInfo::resizeEvent\n"); + QWidget::resizeEvent(ev); + setLabelText(); + setLabelFont(); +} + } // namespace MusEWidget diff --git a/muse2/muse/widgets/mtrackinfo.h b/muse2/muse/widgets/mtrackinfo.h index 42be1f58..42bcb2bf 100644 --- a/muse2/muse/widgets/mtrackinfo.h +++ b/muse2/muse/widgets/mtrackinfo.h @@ -2,6 +2,7 @@ // MusE // Linux Music Editor // (C) Copyright 2010 Werner Schweer and others (ws@seh.de) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -40,7 +41,10 @@ class MidiTrackInfo : public QWidget, public Ui::MidiTrackInfoBase int program, pan, volume; int heartBeatCounter; - private slots: + protected: + virtual void resizeEvent(QResizeEvent*); + + private slots: void iOutputChannelChanged(int); void iOutputPortChanged(int); void iProgHBankChanged(); diff --git a/muse2/muse/widgets/posedit.cpp b/muse2/muse/widgets/posedit.cpp index 0e031c38..772d434a 100644 --- a/muse2/muse/widgets/posedit.cpp +++ b/muse2/muse/widgets/posedit.cpp @@ -77,11 +77,11 @@ class PosEditor : public QLineEdit protected: void init(); - bool event(QEvent *e); - void resizeEvent(QResizeEvent*); - void paintEvent(QPaintEvent*); - void mousePressEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent * event ); + virtual bool event(QEvent *e); + virtual void resizeEvent(QResizeEvent*); + virtual void paintEvent(QPaintEvent*); + virtual void mousePressEvent(QMouseEvent *e); + virtual void keyPressEvent(QKeyEvent * event ); void applyFocusSelection() {} public: @@ -817,8 +817,9 @@ void PosEdit::removeLastNumber(int secNo) // resizeEvent //--------------------------------------------------------- -void PosEdit::resizeEvent(QResizeEvent *) +void PosEdit::resizeEvent(QResizeEvent* ev) { + QWidget::resizeEvent(ev); controls->resize(width(), height()); } diff --git a/muse2/muse/widgets/posedit.h b/muse2/muse/widgets/posedit.h index 3224a3a6..5f763f51 100644 --- a/muse2/muse/widgets/posedit.h +++ b/muse2/muse/widgets/posedit.h @@ -74,9 +74,9 @@ class PosEdit : public QWidget void returnPressed(); protected: - bool event(QEvent *e ); + virtual bool event(QEvent *e ); void timerEvent(QTimerEvent* e); - void resizeEvent(QResizeEvent*); + virtual void resizeEvent(QResizeEvent*); QString sectionFormattedText(int sec); void addNumber(int sec, int num); void removeLastNumber(int sec); diff --git a/muse2/muse/widgets/scrollscale.cpp b/muse2/muse/widgets/scrollscale.cpp index 21ed10b6..e7d40f67 100644 --- a/muse2/muse/widgets/scrollscale.cpp +++ b/muse2/muse/widgets/scrollscale.cpp @@ -197,9 +197,10 @@ void ScrollScale::setPosNoLimit ( unsigned pos ) // resizeEvent //--------------------------------------------------------- -void ScrollScale::resizeEvent ( QResizeEvent* ) +void ScrollScale::resizeEvent ( QResizeEvent* ev) { - setScale ( scale->value() ); + QWidget::resizeEvent(ev); + setScale ( scale->value() ); } //--------------------------------------------------------- diff --git a/muse2/muse/widgets/sigedit.cpp b/muse2/muse/widgets/sigedit.cpp index c2c5a842..a952cfef 100644 --- a/muse2/muse/widgets/sigedit.cpp +++ b/muse2/muse/widgets/sigedit.cpp @@ -103,11 +103,11 @@ class SigEditor : public QLineEdit protected: void init(); - bool event(QEvent *e); - void resizeEvent(QResizeEvent*); - void paintEvent(QPaintEvent*); - void mousePressEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent * event ); + virtual bool event(QEvent *e); + virtual void resizeEvent(QResizeEvent*); + virtual void paintEvent(QPaintEvent*); + virtual void mousePressEvent(QMouseEvent *e); + virtual void keyPressEvent(QKeyEvent * event ); void applyFocusSelection() {} public: @@ -699,9 +699,10 @@ void SigEdit::removeLastNumber(int secNo) // resizeEvent //--------------------------------------------------------- -void SigEdit::resizeEvent(QResizeEvent *) +void SigEdit::resizeEvent(QResizeEvent* ev) { - controls->resize(width(), height()); + QWidget::resizeEvent(ev); + controls->resize(width(), height()); } //--------------------------------------------------------- diff --git a/muse2/muse/widgets/sigedit.h b/muse2/muse/widgets/sigedit.h index 3b1ca635..05684db1 100644 --- a/muse2/muse/widgets/sigedit.h +++ b/muse2/muse/widgets/sigedit.h @@ -72,9 +72,9 @@ class SigEdit : public QWidget void returnPressed(); protected: - bool event(QEvent *e ); + virtual bool event(QEvent *e ); void timerEvent(QTimerEvent* e); - void resizeEvent(QResizeEvent*); + virtual void resizeEvent(QResizeEvent*); QString sectionFormattedText(int sec); void addNumber(int sec, int num); void removeLastNumber(int sec); diff --git a/muse2/muse/widgets/slider.cpp b/muse2/muse/widgets/slider.cpp index 593b3df6..863933d2 100644 --- a/muse2/muse/widgets/slider.cpp +++ b/muse2/muse/widgets/slider.cpp @@ -580,7 +580,7 @@ void Slider::paintEvent(QPaintEvent* /*ev*/) void Slider::resizeEvent(QResizeEvent *e) { - + MusEWidget::SliderBase::resizeEvent(e); d_resized = TRUE; QSize s = e->size(); /* Scale is not supported diff --git a/muse2/muse/widgets/slider.h b/muse2/muse/widgets/slider.h index 5a2bff71..b1281da0 100644 --- a/muse2/muse/widgets/slider.h +++ b/muse2/muse/widgets/slider.h @@ -79,8 +79,8 @@ class Slider : public SliderBase, public ScaleIf virtual void drawSlider (QPainter *p, const QRect &r); double getValue(const QPoint &p); void getScrollMode( QPoint &p, const Qt::MouseButton &button, int &scrollMode, int &direction); - void resizeEvent(QResizeEvent *e); - void paintEvent (QPaintEvent *e); + virtual void resizeEvent(QResizeEvent *e); + virtual void paintEvent (QPaintEvent *e); void valueChange(); void rangeChange(); void scaleChange(); diff --git a/muse2/muse/widgets/swidget.cpp b/muse2/muse/widgets/swidget.cpp index f8461977..51796781 100644 --- a/muse2/muse/widgets/swidget.cpp +++ b/muse2/muse/widgets/swidget.cpp @@ -32,7 +32,8 @@ namespace MusEWidget { void SWidget::resizeEvent(QResizeEvent* ev) { - emit heightChanged(ev->size().height()); + QWidget::resizeEvent(ev); + emit heightChanged(ev->size().height()); } } // namespace MusEWidget diff --git a/muse2/muse/widgets/verticalmeter.cpp b/muse2/muse/widgets/verticalmeter.cpp index 74b4b695..4553b156 100644 --- a/muse2/muse/widgets/verticalmeter.cpp +++ b/muse2/muse/widgets/verticalmeter.cpp @@ -333,8 +333,9 @@ void VerticalMeter::drawVU(QPainter& p, int w, int h, int xv) // resizeEvent //--------------------------------------------------------- -void VerticalMeter::resizeEvent(QResizeEvent* /*ev*/) +void VerticalMeter::resizeEvent(QResizeEvent* ev) { + MusEWidget::Meter::resizeEvent(ev); } } // namespace MusEWidget diff --git a/muse2/muse/widgets/verticalmeter.h b/muse2/muse/widgets/verticalmeter.h index d6bee245..024ecc10 100644 --- a/muse2/muse/widgets/verticalmeter.h +++ b/muse2/muse/widgets/verticalmeter.h @@ -47,8 +47,8 @@ class VerticalMeter : public Meter { void drawVU(QPainter& p, int, int, int); - void paintEvent(QPaintEvent*); - void resizeEvent(QResizeEvent*); + virtual void paintEvent(QPaintEvent*); + virtual void resizeEvent(QResizeEvent*); public slots: void resetPeaks(); diff --git a/muse2/muse/widgets/view.cpp b/muse2/muse/widgets/view.cpp index 9be66ed5..8a9d82b4 100644 --- a/muse2/muse/widgets/view.cpp +++ b/muse2/muse/widgets/view.cpp @@ -290,8 +290,9 @@ void View::setYPos(int y) // resizeEvent //--------------------------------------------------------- -void View::resizeEvent(QResizeEvent* /*ev*/) +void View::resizeEvent(QResizeEvent* ev) { + QWidget::resizeEvent(ev); #ifdef VIEW_USE_DOUBLE_BUFFERING //pm.resize(ev->size()); //printf("View::resizeEvent width:%d height:%d\n", diff --git a/muse2/synti/deicsonze/deicsonzegui.h b/muse2/synti/deicsonze/deicsonzegui.h index f82e072b..7dec344f 100644 --- a/muse2/synti/deicsonze/deicsonzegui.h +++ b/muse2/synti/deicsonze/deicsonzegui.h @@ -526,10 +526,10 @@ class QFramePitchEnvelope:private QFrame { void env2Points(int pl1, int pl2, int pl3, int pr1, int pr2, int pr3); void updateEnv(void) {update();}; protected: - void paintEvent(QPaintEvent* e); - void mouseMoveEvent(QMouseEvent* e); - void mousePressEvent(QMouseEvent * e); - void mouseReleaseEvent(QMouseEvent * e); + virtual void paintEvent(QPaintEvent* e); + virtual void mouseMoveEvent(QMouseEvent* e); + virtual void mousePressEvent(QMouseEvent * e); + virtual void mouseReleaseEvent(QMouseEvent * e); }; class QFrameEnvelope:private QFrame { |