#include <QPen>
#include <QBrush>
-Guide::Guide(CustomTrackView *view, GenTime pos, QString label, double fps, double height)
- : QGraphicsLineItem(), m_view(view), m_position(pos), m_label(label), m_fps(fps)
+Guide::Guide(CustomTrackView *view, GenTime pos, QString label, double fps, double height) :
+ QGraphicsLineItem(),
+ m_position(pos),
+ m_label(label),
+ m_fps(fps),
+ m_view(view)
{
setFlags(QGraphicsItem::ItemIsMovable);
setToolTip(label);
setLine(0, 0, 0, height);
setPos(m_position.frames(m_fps), 0);
- setPen(QPen(QBrush(QColor(0, 0, 200, 180)), 1));
+ setPen(QPen(QBrush(QColor(0, 0, 200, 180)), 2));
setZValue(999);
setAcceptsHoverEvents(true);
const QFontMetrics metric = m_view->fontMetrics();
} else return QGraphicsLineItem::boundingRect();
}
+// virtual
+QPainterPath Guide::shape() const
+{
+ QPainterPath path;
+ path.addRect(line().x1() - pen().widthF() / 2, line().y1(), pen().widthF(), line().y2() - line().y1());
+ if (KdenliveSettings::showmarkers()) {
+ const QFontMetrics metric = m_view->fontMetrics();
+ int height = metric.height();
+ path.addRoundedRect(line().x1(), line().y1() + 10, m_width / static_cast <CustomTrackScene*>(scene())->scale(), height, 3, 3);
+ }
+ return path;
+}
+
// virtual
void Guide::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option*/, QWidget */*w*/)
{