- channellist, bouquetlist and bouqueteditor: fix pagedown logic

This commit is contained in:
svenhoefer
2015-11-08 19:30:59 +01:00
parent b6cd3d055d
commit ed4adff745
4 changed files with 4 additions and 4 deletions

View File

@@ -293,7 +293,7 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey*
int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1
int new_selected = selected + step; int new_selected = selected + step;
if (new_selected >= (int) Bouquets->size()) { if (new_selected >= (int) Bouquets->size()) {
if ((Bouquets->size() - listmaxshow -1 < selected) && (selected != (Bouquets->size() - 1)) && (step != 1)) if (((Bouquets->size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Bouquets->size() - 1)))
new_selected = Bouquets->size() - 1; new_selected = Bouquets->size() - 1;
else if (((Bouquets->size() / listmaxshow) + 1) * listmaxshow == Bouquets->size() + listmaxshow) // last page has full entries else if (((Bouquets->size() / listmaxshow) + 1) * listmaxshow == Bouquets->size() + listmaxshow) // last page has full entries
new_selected = 0; new_selected = 0;

View File

@@ -374,7 +374,7 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey*
int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1
int new_selected = selected + step; int new_selected = selected + step;
if (new_selected >= (int) Channels->size()) { if (new_selected >= (int) Channels->size()) {
if ((Channels->size() - listmaxshow -1 < selected) && (selected != (Channels->size() - 1)) && (step != 1)) if (((Channels->size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Channels->size() - 1)))
new_selected = Channels->size() - 1; new_selected = Channels->size() - 1;
else if (((Channels->size() / listmaxshow) + 1) * listmaxshow == Channels->size() + listmaxshow) // last page has full entries else if (((Channels->size() / listmaxshow) + 1) * listmaxshow == Channels->size() + listmaxshow) // last page has full entries
new_selected = 0; new_selected = 0;

View File

@@ -547,7 +547,7 @@ int CBouquetList::show(bool bShowChannelList)
int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1
int new_selected = selected + step; int new_selected = selected + step;
if (new_selected >= (int) Bouquets.size()) { if (new_selected >= (int) Bouquets.size()) {
if ((Bouquets.size() - listmaxshow -1 < selected) && (selected != (Bouquets.size() - 1)) && (step != 1)) if (((Bouquets.size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Bouquets.size() - 1)))
new_selected = Bouquets.size() - 1; new_selected = Bouquets.size() - 1;
else if (((Bouquets.size() / listmaxshow) + 1) * listmaxshow == Bouquets.size() + listmaxshow) // last page has full entries else if (((Bouquets.size() / listmaxshow) + 1) * listmaxshow == Bouquets.size() + listmaxshow) // last page has full entries
new_selected = 0; new_selected = 0;

View File

@@ -748,7 +748,7 @@ int CChannelList::show()
int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1
int new_selected = selected + step; int new_selected = selected + step;
if (new_selected >= (int) (*chanlist).size()) { if (new_selected >= (int) (*chanlist).size()) {
if (((*chanlist).size() - listmaxshow -1 < selected) && (selected != ((*chanlist).size() - 1)) && (step != 1)) if ((((*chanlist).size() - listmaxshow -1 < selected) && (step != 1)) || (selected != ((*chanlist).size() - 1)))
new_selected = (*chanlist).size() - 1; new_selected = (*chanlist).size() - 1;
else if ((((*chanlist).size() / listmaxshow) + 1) * listmaxshow == (*chanlist).size() + listmaxshow) // last page has full entries else if ((((*chanlist).size() / listmaxshow) + 1) * listmaxshow == (*chanlist).size() + listmaxshow) // last page has full entries
new_selected = 0; new_selected = 0;