#include <QGraphicsScene>
#include <QMimeData>
-ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double fps, double speed, bool generateThumbs)
- : AbstractClipItem(info, QRectF(), fps), m_clip(clip), m_resizeMode(NONE), m_grabPoint(0), m_maxTrack(0), m_hasThumbs(false), startThumbTimer(NULL), endThumbTimer(NULL), audioThumbWasDrawn(false), m_opacity(1.0), m_timeLine(0), m_startThumbRequested(false), m_endThumbRequested(false), m_startFade(0), m_endFade(0), m_hover(false), m_selectedEffect(-1), m_speed(speed), framePixelWidth(0), m_startPix(QPixmap()), m_endPix(QPixmap()), m_videoOnly(false), m_audioOnly(false)
+ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double fps, double speed, bool generateThumbs) :
+ AbstractClipItem(info, QRectF(), fps),
+ m_clip(clip),
+ m_resizeMode(NONE),
+ m_grabPoint(0),
+ m_startFade(0),
+ m_endFade(0),
+ m_maxTrack(0),
+ m_audioOnly(false),
+ m_videoOnly(false),
+ m_startPix(QPixmap()),
+ m_endPix(QPixmap()),
+ m_hasThumbs(false),
+ startThumbTimer(NULL),
+ endThumbTimer(NULL),
+ m_selectedEffect(-1),
+ m_opacity(1.0),
+ m_timeLine(0),
+ m_startThumbRequested(false),
+ m_endThumbRequested(false),
+ m_hover(false),
+ m_speed(speed),
+ audioThumbWasDrawn(false),
+ framePixelWidth(0)
{
setZValue(1);
setRect(0, 0, (info.endPos - info.startPos).frames(fps) - 0.02, (double)(KdenliveSettings::trackheight() - 2));
const QRectF r1(framepos + 0.04, 10, itemWidth - framepos - 2, itemHeight - 10);
const QRectF r2 = painter->matrix().mapRect(r1);
const QRectF txtBounding = painter->boundingRect(r2, Qt::AlignLeft | Qt::AlignTop, ' ' + (*it).comment() + ' ');
-
- QPainterPath path;
- path.addRoundedRect(txtBounding, 3, 3);
- painter->fillPath(path, markerBrush);
+ painter->setBrush(markerBrush);
+ painter->setPen(Qt::NoPen);
+ painter->drawRoundedRect(txtBounding, 3, 3);
+ painter->setPen(Qt::white);
painter->drawText(txtBounding, Qt::AlignCenter, (*it).comment());
}
//painter->fillRect(QRect(br.x() + framepos, br.y(), 10, br.height()), QBrush(QColor(0, 0, 0, 150)));
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));
- QPainterPath path;
- path.addRoundedRect(txtBounding, 4, 4);
- painter->fillPath(path/*.intersected(resultClipPath)*/, markerBrush);
+ 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 frame around clip
QColor frameColor(Qt::black);
int alphaBase = 60;
- if (isSelected() || parentItem() && parentItem()->isSelected()) {
+ if (isSelected() || (parentItem() && parentItem()->isSelected())) {
frameColor = QColor(Qt::red);
alphaBase = 90;
}