Add shortcut that jumps to the markerline
[quassel.git] / src / qtui / markerlineitem.cpp
index 9782a79..563ef4e 100644 (file)
 
 MarkerLineItem::MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent)
   : QGraphicsObject(parent),
-    _boundingRect(0, 0, sceneWidth, 1)
+    _boundingRect(0, 0, sceneWidth, 1),
+    _chatLine(0)
 {
+  setVisible(false);
   setZValue(8);
   styleChanged(); // init brush and height
   connect(QtUi::style(), SIGNAL(changed()), SLOT(styleChanged()));
 }
 
+void MarkerLineItem::setChatLine(ChatLine *line) {
+  _chatLine = line;
+  if(!line)
+    setVisible(false);
+}
+
 void MarkerLineItem::styleChanged() {
   _brush = QtUi::style()->brush(UiStyle::MarkerLine);