]> sigrok.org Git - pulseview.git/blobdiff - pv/view/rowitem.cpp
ViewItemPaintParams: Added missing include
[pulseview.git] / pv / view / rowitem.cpp
index 6e87de1019514a9a2ffa2727f0c1d5a63ea6f270..07540c1b157437375a3e3ce95bb97eaee8e7a152 100644 (file)
@@ -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")
@@ -61,13 +61,18 @@ void RowItem::set_visual_v_offset(int v_offset)
        visual_v_offset_ = v_offset;
 
        if (owner_)
-               owner_->appearance_changed(true, true);
+               owner_->row_item_appearance_changed(true, true);
 }
 
 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,30 +120,15 @@ int RowItem::get_visual_y() const
        return visual_v_offset_ + owner_->owner_visual_v_offset();
 }
 
-QPoint RowItem::point() const
-{
-       return QPoint(0, visual_v_offset());
-}
-
-void RowItem::paint_back(QPainter &p, int left, int right)
-{
-       (void)p;
-       (void)left;
-       (void)right;
-}
-
-void RowItem::paint_mid(QPainter &p, int left, int right)
+void RowItem::drag_by(const QPoint &delta)
 {
-       (void)p;
-       (void)left;
-       (void)right;
+       force_to_v_offset(drag_point_.y() + delta.y() -
+               owner_->owner_visual_v_offset());
 }
 
-void RowItem::paint_fore(QPainter &p, int left, int right)
+QPoint RowItem::point(const QRect &rect) const
 {
-       (void)p;
-       (void)left;
-       (void)right;
+       return QPoint(rect.right(), get_visual_y());
 }
 
 void RowItem::hover_point_changed()