// would be clipped away.
const QRect r = rect().adjusted(0, 0, 0, -BaselineOffset);
- // Draw the cursors
- if (view_.cursors_shown())
- view_.cursors()->paint_label(p, r);
+ // Draw the items
+ const vector< shared_ptr<TimeItem> > items(view_.time_items());
+ for (auto &m : items)
+ m->paint_label(p, r);
}
void CursorHeader::mouseMoveEvent(QMouseEvent *e)
assert(first_);
assert(second_);
+ if (!enabled())
+ return;
+
const unsigned int prefix = view_.tick_prefix();
compute_text_size(p, prefix);
p.drawText(text_rect, Qt::AlignCenter | Qt::AlignVCenter,
pv::util::format_time(second_->time() - first_->time(), prefix, 2));
}
-
- // Paint the cursor markers
- first_->paint_label(p, rect);
- second_->paint_label(p, rect);
}
void CursorPair::draw_viewport_background(QPainter &p,