mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
gui/filebrowser: fix page up/down
Conflicts:
src/gui/filebrowser.cpp
Origin commit data
------------------
Commit: f63c3da37c
Author: martii <m4rtii@gmx.de>
Date: 2014-04-09 (Wed, 09 Apr 2014)
This commit is contained in:
@@ -806,41 +806,6 @@ bool CFileBrowser::exec(const char * const dirname)
|
||||
msg_repeatok = CRCInput::RC_down; // jump to next item
|
||||
}
|
||||
}
|
||||
else if ((msg == CRCInput::RC_red) || msg == (neutrino_msg_t) g_settings.key_pagedown)
|
||||
{
|
||||
if (!(filelist.empty())) {
|
||||
unsigned int last = filelist.size() - 1;
|
||||
if (selected != last && selected + listmaxshow >= filelist.size()) {
|
||||
unsigned int prevselected = selected;
|
||||
selected = last;
|
||||
paintItem(prevselected - liststart);
|
||||
paintItem(selected - liststart);
|
||||
}
|
||||
else
|
||||
{
|
||||
selected = (selected == last) ? 0 : selected + listmaxshow;
|
||||
liststart = (selected / listmaxshow) * listmaxshow;
|
||||
paint();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (msg == CRCInput::RC_green || msg == (neutrino_msg_t) g_settings.key_pageup)
|
||||
{
|
||||
if (!(filelist.empty())) {
|
||||
if (selected && selected < listmaxshow) {
|
||||
unsigned int prevselected = selected;
|
||||
selected = 0;
|
||||
paintItem(prevselected - liststart);
|
||||
paintItem(selected - liststart);
|
||||
}
|
||||
else
|
||||
{
|
||||
selected = selected ? selected - listmaxshow : filelist.size() - 1;
|
||||
liststart = (selected/listmaxshow)*listmaxshow;
|
||||
paint();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (msg_repeatok == CRCInput::RC_up)
|
||||
{
|
||||
if (!(filelist.empty()))
|
||||
@@ -930,6 +895,35 @@ bool CFileBrowser::exec(const char * const dirname)
|
||||
ChangeDir("..");
|
||||
}
|
||||
}
|
||||
else if ((msg == CRCInput::RC_red) || msg == (neutrino_msg_t) g_settings.key_pagedown)
|
||||
{
|
||||
if (!(filelist.empty())) {
|
||||
unsigned int last = filelist.size() - 1;
|
||||
if (selected != last && selected + listmaxshow >= filelist.size()) {
|
||||
selected = last;
|
||||
}
|
||||
else
|
||||
{
|
||||
selected = (selected == last) ? 0 : selected + listmaxshow;
|
||||
liststart = (selected / listmaxshow) * listmaxshow;
|
||||
}
|
||||
paint();
|
||||
}
|
||||
}
|
||||
else if (msg == CRCInput::RC_green || msg == (neutrino_msg_t) g_settings.key_pageup)
|
||||
{
|
||||
if (!(filelist.empty())) {
|
||||
if (selected && selected < listmaxshow) {
|
||||
selected = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
selected = selected ? selected - listmaxshow : filelist.size() - 1;
|
||||
liststart = (selected/listmaxshow)*listmaxshow;
|
||||
}
|
||||
paint();
|
||||
}
|
||||
}
|
||||
else if ( msg == CRCInput::RC_blue )
|
||||
{
|
||||
if(Filter != NULL)
|
||||
|
Reference in New Issue
Block a user