From ba50008ddf73cc8f6c01ee8f44c27b11a482b103 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 14 Jun 2017 14:57:09 +0200 Subject: [PATCH] bouquetlist: use getScrollBarData() function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b0c630607f3399af8f149e4e538acadfe2dd7859 Author: vanhofen Date: 2017-06-14 (Wed, 14 Jun 2017) Origin message was: ------------------ - bouquetlist: use getScrollBarData() function ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index e6bb139ad..2d0bfe5c9 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -720,7 +720,6 @@ void CBouquetList::paint() CInfoClock::getInstance()->disableInfoClock(); liststart = (selected/listmaxshow)*listmaxshow; int lastnum = liststart + listmaxshow; - int bsize = Bouquets.empty() ? 1 : Bouquets.size(); numwidth = 0; int maxDigitWidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getMaxDigitWidth(); @@ -753,9 +752,9 @@ void CBouquetList::paint() } } - int _listmaxshow = listmaxshow ? listmaxshow : 1; //avoid division by zero - int total_pages = ((bsize - 1) / _listmaxshow) + 1; - int current_page = selected / _listmaxshow; + int total_pages; + int current_page; + getScrollBarData(&total_pages, ¤t_page, Bouquets.size(), listmaxshow, selected); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); }