- // Draw effects names
- if (!m_effectNames.isEmpty() && itemWidth * scale > 40) {
- QRectF txtBounding = painter->boundingRect(mapped, Qt::AlignLeft | Qt::AlignTop, m_effectNames);
- txtBounding.setRight(txtBounding.right() + 15);
- painter->setPen(Qt::white);
- QBrush markerBrush(Qt::SolidPattern);
- if (m_timeLine && m_timeLine->state() == QTimeLine::Running) {
- qreal value = m_timeLine->currentValue();
- txtBounding.setWidth(txtBounding.width() * value);
- markerBrush.setColor(QColor(50 + 200 *(1.0 - value), 50, 50, 100 + 50 * value));
- } else markerBrush.setColor(QColor(50, 50, 50, 150));
- painter->setBrush(markerBrush);
- painter->setPen(Qt::NoPen);
- painter->drawRoundedRect(txtBounding, 3, 3);
- painter->setPen(Qt::white);
- painter->drawText(txtBounding, Qt::AlignCenter, m_effectNames);
- painter->setPen(Qt::black);
- }
-
- // Draw clip name
- QColor frameColor(Qt::black);
- int alphaBase = 60;
- if (isSelected() || (parentItem() && parentItem()->isSelected())) {
- frameColor = QColor(Qt::red);
- alphaBase = 90;
- }
- frameColor.setAlpha(150);
- QRectF txtBounding = painter->boundingRect(mapped, Qt::AlignHCenter | Qt::AlignVCenter, ' ' + m_clipName + ' ');
- painter->fillRect(txtBounding, frameColor);
- //painter->setPen(QColor(0, 0, 0, 180));
- //painter->drawText(txtBounding, Qt::AlignCenter, m_clipName);
- if (m_videoOnly) {
- painter->drawPixmap(txtBounding.topLeft() - QPointF(17, -1), m_videoPix);
- } else if (m_audioOnly) {
- painter->drawPixmap(txtBounding.topLeft() - QPointF(17, -1), m_audioPix);
- }
- txtBounding.translate(QPointF(1, 1));
- painter->setPen(QColor(255, 255, 255, 255));
- painter->drawText(txtBounding, Qt::AlignCenter, m_clipName);
-
-
- // draw transition handles on hover
- /*if (m_hover && itemWidth * scale > 40) {
- QPointF p1 = painter->matrix().map(QPointF(0, itemHeight / 2)) + QPointF(10, 0);
- painter->drawPixmap(p1, projectScene()->m_transitionPixmap);
- p1 = painter->matrix().map(QPointF(itemWidth, itemHeight / 2)) - QPointF(22, 0);
- painter->drawPixmap(p1, projectScene()->m_transitionPixmap);
- }*/