coloured_bg_ = state;
}
+bool Trace::is_draggable() const
+{
+ const View *const view = owner_->view();
+ assert(view);
+
+ QPoint cursor_pos = view->mapFromGlobal(QCursor::pos());
+
+ // The signal is draggable only in the header area
+ return (cursor_pos.x() <= view->header_size().width());
+}
+
void Trace::paint_label(QPainter &p, const QRect &rect, bool hover)
{
const int y = get_visual_y();
*/
void set_coloured_bg(bool state);
+ /**
+ * Returns true if the item may be dragged/moved.
+ */
+ bool is_draggable() const;
+
/**
* Computes the outline rectangle of the viewport hit-box.
* @param rect the rectangle of the viewport area.
return viewport_;
}
+const QSize View::header_size() const
+{
+ return header_->sizeHint();
+}
+
vector< shared_ptr<TimeItem> > View::time_items() const
{
const vector<shared_ptr<Flag>> f(flags());
const Viewport* viewport() const;
+ const QSize header_size() const;
+
/**
* Gets a list of time markers.
*/