]> git.sesse.net Git - kdenlive/blobdiff - src/guide.cpp
Move document position property to documentproperties section
[kdenlive] / src / guide.cpp
index b6c05a435232fa0d8da5fb81e5d89b07a1934741..4fbc53b9bbe550177836c0b66b702a18f490894b 100644 (file)
@@ -38,7 +38,7 @@ Guide::Guide(CustomTrackView *view, GenTime pos, QString label, double fps, doub
     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();
@@ -111,11 +111,24 @@ QRectF Guide::boundingRect() const
     if (KdenliveSettings::showmarkers()) {
         QRectF rect = QGraphicsLineItem::boundingRect();
         rect.setLeft(line().x1());
-        rect.setWidth(m_width / static_cast <CustomTrackScene*>(scene())->scale());
+        rect.setWidth(m_width / static_cast <CustomTrackScene*>(scene())->scale().x());
         return rect;
     } 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().x(), height, 3, 3);
+    }
+    return path;
+}
+
 // virtual
 void Guide::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option*/, QWidget */*w*/)
 {