- draw_hover_mark(p);
-
- p.end();
-}
-
-void Ruler::mouseMoveEvent(QMouseEvent *e)
-{
- if (!_grabbed_marker)
- return;
-
- _grabbed_marker->set_time(_view.offset() +
- ((double)e->x() + 0.5) * _view.scale());
-}
-
-void Ruler::mousePressEvent(QMouseEvent *e)
-{
- if (e->buttons() & Qt::LeftButton) {
- _grabbed_marker = NULL;
-
- if (_view.cursors_shown()) {
- std::pair<Cursor, Cursor> &cursors =
- _view.cursors();
- if (cursors.first.get_label_rect(
- rect()).contains(e->pos()))
- _grabbed_marker = &cursors.first;
- else if (cursors.second.get_label_rect(
- rect()).contains(e->pos()))
- _grabbed_marker = &cursors.second;
- }
+ draw_hover_mark(p, text_height);
+
+ // The cursor labels are not drawn with the arrows exactly on the
+ // bottom line of the widget, because then the selection shadow
+ // would be clipped away.
+ const QRect r = rect().adjusted(0, 0, 0, -ViewItem::HighlightRadius);
+
+ // Draw the items
+ const vector< shared_ptr<TimeItem> > items(view_.time_items());
+ for (auto &i : items) {
+ const bool highlight = !item_dragging_ &&
+ i->label_rect(r).contains(mouse_point_);
+ i->paint_label(p, r, highlight);