filebrowser: use getScrollBarData() function

Signed-off-by: Thilo Graf <dbt@novatux.de>


Origin commit data
------------------
Branch: ni/coolstream
Commit: 28b3cc80df
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-06-15 (Thu, 15 Jun 2017)

Origin message was:
------------------
- filebrowser: use getScrollBarData() function

Signed-off-by: Thilo Graf <dbt@novatux.de>


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-06-15 01:01:55 +02:00
committed by Thilo Graf
parent 578791847e
commit 59435af21a

View File

@@ -1472,8 +1472,9 @@ void CFileBrowser::paint()
paintItem(count); paintItem(count);
//scrollbar //scrollbar
int total_pages = filelist.size() == 0 ? 1 : ((filelist.size() - 1) / listmaxshow) + 1; int total_pages;
int current_page = (selected / listmaxshow); int current_page;
getScrollBarData(&total_pages, &current_page, filelist.size(), listmaxshow, selected);
paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page);
} }