X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fviewport.cpp;h=c85f915a591eba05e36791f870509da3b943eebe;hb=be9e7b4bb29b6594ec2b64442748ab135b684bf8;hp=afff74eec85c17f5d1db0845d91a1f37e1660ffe;hpb=376219314d9f1a792aa6a7ecf44314ba3422880d;p=pulseview.git diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index afff74e..c85f915 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -52,19 +52,17 @@ Viewport::Viewport(View &parent) : setAutoFillBackground(true); setBackgroundRole(QPalette::Base); - connect(&_view.session(), SIGNAL(signals_changed()), - this, SLOT(on_signals_changed())); - connect(&_view, SIGNAL(signals_moved()), this, SLOT(on_signals_moved())); } -int Viewport::get_total_height() const +void Viewport::signals_updated() { - int h = 0; - for (auto &i : _view) - h = max(i->v_offset() + View::SignalHeight, h); - return h; + for (shared_ptr r : _view) { + assert(r); + connect(r.get(), SIGNAL(appearance_changed()), + this, SLOT(update())); + } } void Viewport::paintEvent(QPaintEvent*) @@ -72,7 +70,7 @@ void Viewport::paintEvent(QPaintEvent*) vector< shared_ptr > row_items(_view.begin(), _view.end()); stable_sort(row_items.begin(), row_items.end(), [](const shared_ptr &a, const shared_ptr &b) { - return a->v_offset() < b->v_offset(); }); + return a->visual_v_offset() < b->visual_v_offset(); }); QPainter p(this); p.setRenderHint(QPainter::Antialiasing); @@ -225,15 +223,6 @@ bool Viewport::touchEvent(QTouchEvent *event) return true; } -void Viewport::on_signals_changed() -{ - for (shared_ptr r : _view) { - assert(r); - connect(r.get(), SIGNAL(visibility_changed()), - this, SLOT(update())); - } -} - void Viewport::on_signals_moved() { update();