X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fview.cpp;h=c09609ac65d49daa9a9ad8988ff805f84cc39a6f;hp=9cc1487e9dc30216c5e146d85c46ae48a44d291b;hb=4d4766471d0900ea6e771be1354c21c5e745c1e6;hpb=819e2e95555b2b3c2190f24a3cfa82250d1f34e5 diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 9cc1487e..c09609ac 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -84,10 +84,6 @@ const int View::MaxScrollValue = INT_MAX / 2; const int View::ScaleUnits[3] = {1, 2, 5}; -const QColor View::CursorAreaColour(220, 231, 243); - -const QSizeF View::LabelPadding(4, 0); - View::View(Session &session, QWidget *parent) : QAbstractScrollArea(parent), session_(session), @@ -96,7 +92,6 @@ View::View(Session &session, QWidget *parent) : header_(new Header(*this)), scale_(1e-6), offset_(0), - v_offset_(0), updating_scroll_(false), tick_period_(0.0), tick_prefix_(0), @@ -108,7 +103,7 @@ View::View(Session &session, QWidget *parent) : connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(h_scroll_value_changed(int))); connect(verticalScrollBar(), SIGNAL(valueChanged(int)), - this, SLOT(v_scroll_value_changed(int))); + this, SLOT(v_scroll_value_changed())); connect(&session_, SIGNAL(signals_changed()), this, SLOT(signals_changed())); @@ -119,9 +114,6 @@ View::View(Session &session, QWidget *parent) : connect(&session_, SIGNAL(frame_ended()), this, SLOT(data_updated())); - connect(header_, SIGNAL(signals_moved()), - this, SLOT(on_signals_moved())); - connect(header_, SIGNAL(selection_changed()), ruler_, SLOT(clear_selection())); connect(ruler_, SIGNAL(selection_changed()), @@ -209,7 +201,14 @@ double View::offset() const int View::owner_visual_v_offset() const { - return -v_offset_; + return -verticalScrollBar()->sliderPosition(); +} + +void View::set_v_offset(int offset) +{ + verticalScrollBar()->setSliderPosition(offset); + header_->update(); + viewport_->update(); } unsigned int View::depth() const @@ -663,9 +662,8 @@ void View::h_scroll_value_changed(int value) viewport_->update(); } -void View::v_scroll_value_changed(int value) +void View::v_scroll_value_changed() { - v_offset_ = value; header_->update(); viewport_->update(); } @@ -749,18 +747,14 @@ void View::data_updated() viewport_->update(); } -void View::on_signals_moved() -{ - update_scroll(); - signals_moved(); -} - void View::process_sticky_events() { if (sticky_events_ & RowItemHExtentsChanged) update_layout(); - if (sticky_events_ & RowItemVExtentsChanged) + if (sticky_events_ & RowItemVExtentsChanged) { restack_all_row_items(); + update_scroll(); + } // Clear the sticky events sticky_events_ = 0;