From cf44e1a97438c347137b17e90b6eb898c5423781 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 15 Jun 2017 01:01:55 +0200 Subject: [PATCH] - pictureviewer: use getScrollBarData() function Signed-off-by: Thilo Graf --- src/gui/pictureviewer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 6fde49fb9..50d9a7086 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -749,9 +749,9 @@ void CPictureViewerGui::paint() } //scrollbar - int _listmaxshow = listmaxshow ? listmaxshow : 1; //avoid division by zero - int total_pages = playlist.size() == 0 ? 1 : ((playlist.size() - 1) / _listmaxshow) + 1; - int current_page = selected / _listmaxshow; + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, playlist.size(), listmaxshow, selected); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page);