mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
gui/filebrowser: rework page-up/-down
Conflicts:
src/gui/filebrowser.cpp
Origin commit data
------------------
Branch: ni/coolstream
Commit: b4ca0290a3
Author: martii <m4rtii@gmx.de>
Date: 2014-03-22 (Sat, 22 Mar 2014)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -772,7 +772,7 @@ bool CFileBrowser::exec(const char * const dirname)
|
|||||||
|
|
||||||
ChangeDir(name, selection);
|
ChangeDir(name, selection);
|
||||||
|
|
||||||
int oldselected = selected;
|
unsigned int oldselected = selected;
|
||||||
|
|
||||||
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_FILEBROWSER]);
|
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_FILEBROWSER]);
|
||||||
|
|
||||||
@@ -806,62 +806,80 @@ bool CFileBrowser::exec(const char * const dirname)
|
|||||||
msg_repeatok = CRCInput::RC_down; // jump to next item
|
msg_repeatok = CRCInput::RC_down; // jump to next item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ((msg == CRCInput::RC_red) || msg == (neutrino_msg_t) g_settings.key_pagedown)
|
||||||
if ((msg == CRCInput::RC_red) || msg == CRCInput::RC_page_down)
|
|
||||||
{
|
{
|
||||||
selected += listmaxshow;
|
if (!(filelist.empty())) {
|
||||||
if (selected >= filelist.size()) {
|
unsigned int last = filelist.size() - 1;
|
||||||
if (((filelist.size() / listmaxshow) + 1) * listmaxshow == filelist.size() + listmaxshow) // last page has full entries
|
if (selected != last && selected + listmaxshow >= filelist.size()) {
|
||||||
selected = 0;
|
unsigned int prevselected = selected;
|
||||||
|
selected = last;
|
||||||
|
paintItem(prevselected - liststart);
|
||||||
|
paintItem(selected - liststart);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
selected = selected < (((filelist.size() / listmaxshow) + 1) * listmaxshow) ? (filelist.size() - 1) : 0;
|
{
|
||||||
|
selected = (selected == last) ? 0 : selected + listmaxshow;
|
||||||
|
liststart = (selected / listmaxshow) * listmaxshow;
|
||||||
|
paint();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
liststart = (selected / listmaxshow) * listmaxshow;
|
|
||||||
paint();
|
|
||||||
}
|
}
|
||||||
else if ((msg == CRCInput::RC_green) || (msg == CRCInput::RC_page_up) )
|
else if (msg == CRCInput::RC_green || msg == (neutrino_msg_t) g_settings.key_pageup)
|
||||||
{
|
{
|
||||||
if ((int(selected)-int(listmaxshow))<0)
|
if (!(filelist.empty())) {
|
||||||
selected=filelist.size()-1;
|
if (selected && selected < listmaxshow) {
|
||||||
else
|
unsigned int prevselected = selected;
|
||||||
selected -= listmaxshow;
|
selected = 0;
|
||||||
liststart = (selected/listmaxshow)*listmaxshow;
|
paintItem(prevselected - liststart);
|
||||||
paint();
|
paintItem(selected - liststart);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selected = selected ? selected - listmaxshow : filelist.size() - 1;
|
||||||
|
liststart = (selected/listmaxshow)*listmaxshow;
|
||||||
|
paint();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (msg_repeatok == CRCInput::RC_up)
|
else if (msg_repeatok == CRCInput::RC_up)
|
||||||
{
|
{
|
||||||
int prevselected=selected;
|
if (!(filelist.empty()))
|
||||||
if(selected==0)
|
|
||||||
{
|
{
|
||||||
selected = filelist.size()-1;
|
unsigned int prevselected=selected;
|
||||||
}
|
unsigned int prevliststart = liststart;
|
||||||
else
|
if (selected)
|
||||||
selected--;
|
selected --;
|
||||||
paintItem(prevselected - liststart);
|
else
|
||||||
unsigned int oldliststart = liststart;
|
selected = filelist.size() - 1;
|
||||||
liststart = (selected/listmaxshow)*listmaxshow;
|
liststart = (selected/listmaxshow)*listmaxshow;
|
||||||
if(oldliststart!=liststart)
|
if(prevliststart!=liststart)
|
||||||
{
|
{
|
||||||
paint();
|
paint();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
paintItem(selected - liststart);
|
paintItem(prevselected - prevliststart);
|
||||||
|
paintItem(selected - liststart);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg_repeatok == CRCInput::RC_down)
|
else if (msg_repeatok == CRCInput::RC_down)
|
||||||
{
|
{
|
||||||
if (!(filelist.empty()))
|
if (!(filelist.empty()))
|
||||||
{
|
{
|
||||||
int prevselected=selected;
|
unsigned int prevselected=selected;
|
||||||
|
unsigned int prevliststart = liststart;
|
||||||
selected = (selected + 1) % filelist.size();
|
selected = (selected + 1) % filelist.size();
|
||||||
paintItem(prevselected - liststart);
|
|
||||||
unsigned int oldliststart = liststart;
|
|
||||||
liststart = (selected/listmaxshow)*listmaxshow;
|
liststart = (selected/listmaxshow)*listmaxshow;
|
||||||
if(oldliststart!=liststart)
|
if(prevliststart!=liststart)
|
||||||
|
{
|
||||||
paint();
|
paint();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
paintItem(prevselected - prevliststart);
|
||||||
paintItem(selected - liststart);
|
paintItem(selected - liststart);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( ( msg == CRCInput::RC_timeout ) )
|
else if ( ( msg == CRCInput::RC_timeout ) )
|
||||||
|
Reference in New Issue
Block a user