From: Joel Holdsworth Date: Sun, 2 Nov 2014 18:49:16 +0000 (+0000) Subject: View: Removed normalize_layout X-Git-Tag: pulseview-0.3.0~454 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4f82e4f613aced3594f07fa219a9d8c247eaed11;p=pulseview.git View: Removed normalize_layout --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 2ab8ed98..514a3e49 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -190,9 +190,7 @@ void Header::mouseLeftReleaseEvent(QMouseEvent *event) for (auto &r : _view) r->drag_release(); - if (_dragging) - _view.normalize_layout(); - else + if (!_dragging) { if (!ctrl_pressed) { for (shared_ptr r : _view) diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 37c3b14a..80ade0d2 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -320,20 +320,6 @@ const QPoint& View::hover_point() const return _hover_point; } -void View::normalize_layout() -{ - int v_min = INT_MAX; - for (const shared_ptr r : *this) - v_min = min(r->v_offset(), v_min); - - const int delta = -min(v_min, 0); - for (shared_ptr r : *this) - r->set_v_offset(r->v_offset() + delta); - - verticalScrollBar()->setSliderPosition(_v_offset + delta); - v_scroll_value_changed(verticalScrollBar()->sliderPosition()); -} - void View::update_viewport() { assert(_viewport); @@ -523,7 +509,6 @@ void View::signals_changed() } update_layout(); - normalize_layout(); // Update the child widgets _header->signals_updated(); diff --git a/pv/view/view.h b/pv/view/view.h index 03528645..07bd5d9c 100644 --- a/pv/view/view.h +++ b/pv/view/view.h @@ -138,8 +138,6 @@ public: const QPoint& hover_point() const; - void normalize_layout(); - void update_viewport(); Q_SIGNALS: