View: Removed normalize_layout
authorJoel Holdsworth <joel@airwebreathe.org.uk>
Sun, 2 Nov 2014 18:49:16 +0000 (18:49 +0000)
committerJoel Holdsworth <joel@airwebreathe.org.uk>
Wed, 19 Nov 2014 10:23:03 +0000 (10:23 +0000)
pv/view/header.cpp
pv/view/view.cpp
pv/view/view.h

index 2ab8ed986568ba4bfeaa36043840b723541ce867..514a3e49694e348dc08123749da90ff0290d1f67 100644 (file)
@@ -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<RowItem> r : _view)
index 37c3b14a1380f45994648099944625b8f4295c21..80ade0d23f5bccd573bb5385d064a1d40d9aec04 100644 (file)
@@ -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<RowItem> r : *this)
-               v_min = min(r->v_offset(), v_min);
-
-       const int delta = -min(v_min, 0);
-       for (shared_ptr<RowItem> 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();
index 0352864500d659152dfd738444d30e8aba02ca38..07bd5d9caeade08c0f75b90da5003c423f8dde7a 100644 (file)
@@ -138,8 +138,6 @@ public:
 
        const QPoint& hover_point() const;
 
-       void normalize_layout();
-
        void update_viewport();
 
 Q_SIGNALS: