mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
channellist.cpp : fix biggest chan number in list
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include <gui/channellist.h>
|
#include <gui/channellist.h>
|
||||||
|
|
||||||
@@ -1899,10 +1900,19 @@ void CChannelList::paintHead()
|
|||||||
|
|
||||||
void CChannelList::paint()
|
void CChannelList::paint()
|
||||||
{
|
{
|
||||||
liststart = (selected/listmaxshow)*listmaxshow;
|
zapit_list_it_t chan_it;
|
||||||
//FIXME do we need to find biggest chan number in list ?
|
std::stringstream ss;
|
||||||
numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("0000");
|
std::string chan_width;
|
||||||
|
int chan_nr_max = 1;
|
||||||
|
unsigned int nr = 0;
|
||||||
|
for (chan_it=chanlist.begin(); chan_it!=chanlist.end(); ++chan_it) {
|
||||||
|
chan_nr_max = std::max(chan_nr_max, chanlist[nr++]->number);
|
||||||
|
}
|
||||||
|
ss << chan_nr_max;
|
||||||
|
ss >> chan_width;
|
||||||
|
numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(chan_width.c_str());
|
||||||
|
|
||||||
|
liststart = (selected/listmaxshow)*listmaxshow;
|
||||||
updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow));
|
updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow));
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(x, y+theight, width, height-footerHeight-theight, COL_MENUCONTENT_PLUS_0, 0, CORNER_BOTTOM);
|
frameBuffer->paintBoxRel(x, y+theight, width, height-footerHeight-theight, COL_MENUCONTENT_PLUS_0, 0, CORNER_BOTTOM);
|
||||||
|
Reference in New Issue
Block a user