- pictureviewer: use getScrollBarData() function

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2017-06-15 01:01:55 +02:00
committed by Thilo Graf
parent 4f32cf25e4
commit cf44e1a974

View File

@@ -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, &current_page, playlist.size(), listmaxshow, selected);
paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page);