From 4c092c26ba64eecbdefbf6ec708fca8ba21b021f Mon Sep 17 00:00:00 2001 From: PushmePullyu <127053144+PushmePullyu@users.noreply.github.com> Date: Sat, 2 Sep 2023 00:45:24 +0200 Subject: [PATCH] GUI: GridWidget: Remove redundant scroll bar update sortGroups(): Move the call to scrollBarRecalc() up and delete superfluous code so the scroll bar is only updated once. --- gui/widgets/grid.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gui/widgets/grid.cpp b/gui/widgets/grid.cpp index 9396b5bc0d0..e45beb9f328 100644 --- a/gui/widgets/grid.cpp +++ b/gui/widgets/grid.cpp @@ -599,16 +599,13 @@ void GridWidget::sortGroups() { calcInnerHeight(); markGridAsInvalid(); - _scrollBar->_currentPos = _scrollPos; - _scrollBar->checkBounds(_scrollBar->_currentPos); - _scrollPos = _scrollBar->_currentPos; + scrollBarRecalc(); if (calcVisibleEntries()) { reloadThumbnails(); } assignEntriesToItems(); - scrollBarRecalc(); // FIXME: Temporary solution to clear/display the background ofthe scrollbar when list // grows too small or large during group toggle. We shouldn't have to redraw the top dialog, // but not doing so the background of scrollbar isn't cleared.