From 4f82e4f613aced3594f07fa219a9d8c247eaed11 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sun, 2 Nov 2014 18:49:16 +0000 Subject: [PATCH] View: Removed normalize_layout --- pv/view/header.cpp | 4 +--- pv/view/view.cpp | 15 --------------- pv/view/view.h | 2 -- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 2ab8ed9..514a3e4 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 37c3b14..80ade0d 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 0352864..07bd5d9 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: -- 2.30.2