{
assert(r);
- const bool highlight = !dragging_ &&
+ const bool highlight = !item_dragging_ &&
r->label_rect(rect).contains(mouse_point_);
r->paint_label(painter, rect, highlight);
}
// Draw the items
const vector< shared_ptr<TimeItem> > items(view_.time_items());
for (auto &i : items) {
- const bool highlight = !dragging_ &&
+ const bool highlight = !item_dragging_ &&
i->label_rect(r).contains(mouse_point_);
i->paint_label(p, r, highlight);
}
ViewWidget::ViewWidget(View &parent) :
QWidget(&parent),
view_(parent),
- dragging_(false)
+ item_dragging_(false)
{
setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true);
for (auto &i : items)
i->drag_release();
- if (dragging_)
+ if (item_dragging_)
view_.restack_all_row_items();
else
{
}
}
- dragging_ = false;
+ item_dragging_ = false;
}
void ViewWidget::mousePressEvent(QMouseEvent *event)
return;
// Do the drag
- dragging_ = true;
+ item_dragging_ = true;
drag_items(event->pos() - mouse_down_point_);
update();
QPoint mouse_point_;
QPoint mouse_down_point_;
std::shared_ptr<ViewItem> mouse_down_item_;
- bool dragging_;
+ bool item_dragging_;
};
} // namespace view