mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
Fix page up/down in page mode
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@648 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -870,14 +870,23 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu
|
||||
switch (this->currentSwapMode) {
|
||||
case SwapMode_ByPage:
|
||||
{
|
||||
int selectedChannelEntryIndex = this->selectedChannelEntry->index;
|
||||
selectedChannelEntryIndex += this->maxNumberOfDisplayableEntries;
|
||||
|
||||
if (selectedChannelEntryIndex > this->channelList->getSize () - 1)
|
||||
selectedChannelEntryIndex = 0;
|
||||
int selected = this->selectedChannelEntry->index;
|
||||
int prev_selected = selected;
|
||||
int step = this->maxNumberOfDisplayableEntries;
|
||||
int listSize = this->channelList->getSize();
|
||||
|
||||
this->createChannelEntries (selectedChannelEntryIndex);
|
||||
selected += step;
|
||||
if(selected >= listSize) {
|
||||
if((listSize - step -1 < prev_selected) && (prev_selected != (listSize - 1)))
|
||||
selected = listSize - 1;
|
||||
else if (((listSize / step) + 1) * step == listSize + step) // last page has full entries
|
||||
selected = 0;
|
||||
else
|
||||
selected = ((selected < (((listSize / step)+1) * step))) ? (listSize - 1) : 0;
|
||||
}
|
||||
|
||||
this->createChannelEntries (selected);
|
||||
this->paint ();
|
||||
}
|
||||
break;
|
||||
@@ -911,14 +920,19 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu
|
||||
switch (this->currentSwapMode) {
|
||||
case SwapMode_ByPage:
|
||||
{
|
||||
int selectedChannelEntryIndex = this->selectedChannelEntry->index;
|
||||
selectedChannelEntryIndex -= this->maxNumberOfDisplayableEntries;
|
||||
int selected = this->selectedChannelEntry->index;
|
||||
int prev_selected = selected;
|
||||
int step = this->maxNumberOfDisplayableEntries;
|
||||
|
||||
if (selectedChannelEntryIndex < 0)
|
||||
selectedChannelEntryIndex = this->channelList->getSize () - 1;
|
||||
|
||||
this->createChannelEntries (selectedChannelEntryIndex);
|
||||
selected -= step;
|
||||
if((prev_selected-step) < 0) {
|
||||
if(prev_selected != 0 && step != 1)
|
||||
selected = 0;
|
||||
else
|
||||
selected = this->channelList->getSize() - 1;
|
||||
}
|
||||
|
||||
this->createChannelEntries (selected);
|
||||
this->paint ();
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user