+ // Draw effects names
+ if (!m_effectNames.isEmpty() && mapped.width() > 40) {
+ QRectF txtBounding = painter->boundingRect(mapped, Qt::AlignLeft | Qt::AlignTop, m_effectNames);
+ QColor bgColor;
+ if (m_timeLine && m_timeLine->state() == QTimeLine::Running) {
+ qreal value = m_timeLine->currentValue();
+ txtBounding.setWidth(txtBounding.width() * value);
+ bgColor.setRgb(50 + 200 *(1.0 - value), 50, 50, 100 + 50 * value);
+ } else bgColor.setRgb(50, 50, 90, 180);
+
+ QPainterPath rounded;
+ rounded.moveTo(txtBounding.bottomRight());
+ rounded.arcTo(txtBounding.right() - txtBounding.height() - 2, txtBounding.top() - txtBounding.height(), txtBounding.height() * 2, txtBounding.height() * 2, 270, 90);
+ rounded.lineTo(txtBounding.topLeft());
+ rounded.lineTo(txtBounding.bottomLeft());
+ painter->fillPath(rounded, bgColor);
+ painter->setPen(Qt::lightGray);
+ painter->drawText(txtBounding.adjusted(1, 0, 1, 0), Qt::AlignCenter, m_effectNames);
+ }
+
+ // Draw clip name
+ QColor frameColor(paintColor.darker());
+ if (isSelected() || (parentItem() && parentItem()->isSelected())) {
+ frameColor = QColor(Qt::red);
+ }
+ frameColor.setAlpha(160);
+
+ const QRectF txtBounding2 = painter->boundingRect(mapped, Qt::AlignHCenter | Qt::AlignVCenter, ' ' + m_clipName + ' ');
+ //painter->fillRect(txtBounding2, frameColor);
+ painter->setBrush(frameColor);
+ painter->setPen(Qt::NoPen);
+ painter->drawRoundedRect(txtBounding2, 3, 3);
+ painter->setBrush(QBrush(Qt::NoBrush));
+
+ //painter->setPen(QColor(0, 0, 0, 180));
+ //painter->drawText(txtBounding, Qt::AlignCenter, m_clipName);
+ if (m_videoOnly) {
+ painter->drawPixmap(txtBounding2.topLeft() - QPointF(17, -1), m_videoPix);
+ } else if (m_audioOnly) {
+ painter->drawPixmap(txtBounding2.topLeft() - QPointF(17, -1), m_audioPix);
+ }
+ painter->setPen(Qt::white);
+ painter->drawText(txtBounding2, Qt::AlignCenter, m_clipName);
+
+