- i->set_time(view_.offset() +
- (i->drag_point().x() + delta - 0.5) *
- view_.scale());
-}
-
-void Ruler::mousePressEvent(QMouseEvent *e)
-{
- if (e->buttons() & Qt::LeftButton) {
- mouse_down_point_ = e->pos();
-
- mouse_down_item_.reset();
-
- clear_selection();
-
- const vector< shared_ptr<TimeItem> > items(view_.time_items());
- for (auto i = items.rbegin(); i != items.rend(); i++)
- if ((*i)->label_rect(rect()).contains(e->pos())) {
- mouse_down_item_ = (*i);
- break;
- }
-
- if (mouse_down_item_) {
- mouse_down_item_->select();
- mouse_down_item_->drag();
- }
-
- selection_changed();
- }