From 166258a54fd93388910b4debfeb96316cae7dd81 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 14 Jun 2017 14:57:09 +0200 Subject: [PATCH] pictureviewer: use getScrollBarData() function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/126d60527bbb9851d98849f3c21ed1fceeb03ec8 Author: vanhofen Date: 2017-06-14 (Wed, 14 Jun 2017) Origin message was: ------------------ - pictureviewer: use getScrollBarData() function ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 5c7ce37c5..8d2a3c186 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -760,9 +760,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);