X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Frowitem.cpp;h=07540c1b157437375a3e3ce95bb97eaee8e7a152;hp=eeb727ccc966cffa86eccbedcf00dc076ade7136;hb=dbf74f26f6bd9fd5277f090fea8e4f5506c19911;hpb=be7170664b80552fdfb38da1c214c271cbf116aa diff --git a/pv/view/rowitem.cpp b/pv/view/rowitem.cpp index eeb727cc..07540c1b 100644 --- a/pv/view/rowitem.cpp +++ b/pv/view/rowitem.cpp @@ -28,7 +28,7 @@ namespace pv { namespace view { RowItem::RowItem() : - owner_(NULL), + owner_(nullptr), layout_v_offset_(0), visual_v_offset_(0), v_offset_animation_(this, "visual_v_offset") @@ -68,6 +68,11 @@ void RowItem::force_to_v_offset(int v_offset) { v_offset_animation_.stop(); layout_v_offset_ = visual_v_offset_ = v_offset; + + if (owner_) { + owner_->row_item_appearance_changed(true, true); + owner_->extents_changed(false, true); + } } void RowItem::animate_to_layout_v_offset() @@ -115,9 +120,15 @@ int RowItem::get_visual_y() const return visual_v_offset_ + owner_->owner_visual_v_offset(); } +void RowItem::drag_by(const QPoint &delta) +{ + force_to_v_offset(drag_point_.y() + delta.y() - + owner_->owner_visual_v_offset()); +} + QPoint RowItem::point(const QRect &rect) const { - return QPoint(rect.right(), visual_v_offset()); + return QPoint(rect.right(), get_visual_y()); } void RowItem::hover_point_changed()