+ setBackgroundRole(QPalette::AlternateBase);
+ setAutoFillBackground(true);
+ if (!info.isBlind)
+ buttonVideo->setIcon(KIcon("kdenlive-show-video"));
+ else
+ buttonVideo->setIcon(KIcon("kdenlive-hide-video"));
+ } else {
+ buttonVideo->setHidden(true);
+ }
+ if (!info.isMute)
+ buttonAudio->setIcon(KIcon("kdenlive-show-audio"));
+ else
+ buttonAudio->setIcon(KIcon("kdenlive-hide-audio"));
+
+ if (!info.isLocked)
+ buttonLock->setIcon(KIcon("kdenlive-unlock"));
+ else
+ buttonLock->setIcon(KIcon("kdenlive-lock"));
+
+ connect(buttonVideo, SIGNAL(clicked()), this, SLOT(switchVideo()));
+ connect(buttonAudio, SIGNAL(clicked()), this, SLOT(switchAudio()));
+ connect(buttonLock, SIGNAL(clicked()), this, SLOT(switchLock()));
+
+ // Don't show track buttons if size is too small
+ if (height < 40) {
+ buttonVideo->setHidden(true);
+ buttonAudio->setHidden(true);
+ buttonLock->setHidden(true);
+ //horizontalSpacer;
+ }
+
+ setContextMenuPolicy(Qt::ActionsContextMenu);
+ addActions(actions);
+}
+
+/*HeaderTrack::~HeaderTrack()
+{
+}*/
+
+void HeaderTrack::updateEffectLabel(const QStringList &effects)
+{
+ if (!effects.isEmpty()) {
+ effect_label->setHidden(false);
+ effect_label->setToolTip(effects.join("/"));
+ } else {
+ effect_label->setHidden(true);
+ effect_label->setToolTip(QString());
+ }
+}
+
+// virtual
+void HeaderTrack::mousePressEvent(QMouseEvent * event)
+{
+ if (track_number->hasFocus()) {
+ track_number->clearFocus();
+ return;
+ }
+ if (!m_isSelected) emit selectTrack(m_index);
+ emit showTrackEffects(m_index);
+ QWidget::mousePressEvent(event);
+}
+
+void HeaderTrack::mouseDoubleClickEvent(QMouseEvent* event)
+{
+ if (track_number->hasFocus()) {
+ track_number->clearFocus();
+ return;
+ }
+ emit configTrack(m_index);
+ QWidget::mouseDoubleClickEvent(event);
+}
+
+//virtual
+void HeaderTrack::dropEvent(QDropEvent * event)
+{
+ const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist"));
+ QDomDocument doc;
+ doc.setContent(effects, true);
+ QDomElement e = doc.documentElement();
+ if (e.tagName() == "effectgroup") {
+ // dropped an effect group
+ QDomNodeList effectlist = e.elementsByTagName("effect");
+ for (int i = 0; i < effectlist.count(); ++i) {
+ effectlist.at(i).toElement().removeAttribute("kdenlive_ix");
+ }