listbox and upnpbrowser: fix pagedown logic

Origin commit data
------------------
Branch: ni/coolstream
Commit: d422e7e649
Author: vanhofen <vanhofen@gmx.de>
Date: 2015-11-08 (Sun, 08 Nov 2015)

Origin message was:
------------------
- listbox and upnpbrowser: fix pagedown logic

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2015-11-08 19:46:35 +01:00
parent 849e936082
commit 840f978305
2 changed files with 2 additions and 2 deletions

View File

@@ -505,7 +505,7 @@ void CUpnpBrowserGui::selectDevice()
int step = ((int) msg == g_settings.key_pagedown) ? m_listmaxshow : 1; // browse or step 1 int step = ((int) msg == g_settings.key_pagedown) ? m_listmaxshow : 1; // browse or step 1
int new_selected = m_selecteddevice + step; int new_selected = m_selecteddevice + step;
if (new_selected >= (int) m_devices.size()) { if (new_selected >= (int) m_devices.size()) {
if ((m_devices.size() - m_listmaxshow -1 < m_selecteddevice) && (m_selecteddevice != (m_devices.size() - 1)) && (step != 1)) if (((m_devices.size() - m_listmaxshow -1 < m_selecteddevice) && (step != 1)) || (m_selecteddevice != (m_devices.size() - 1)))
new_selected = m_devices.size() - 1; new_selected = m_devices.size() - 1;
else if (((m_devices.size() / m_listmaxshow) + 1) * m_listmaxshow == m_devices.size() + m_listmaxshow) // last page has full entries else if (((m_devices.size() / m_listmaxshow) + 1) * m_listmaxshow == m_devices.size() + m_listmaxshow) // last page has full entries
new_selected = 0; new_selected = 0;

View File

@@ -209,7 +209,7 @@ int CListBox::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) getItemCount()) { if (new_selected >= (int) getItemCount()) {
if ((getItemCount() - listmaxshow -1 < selected) && (selected != (getItemCount() - 1)) && (step != 1)) if (((getItemCount() - listmaxshow -1 < selected) && (step != 1)) || (selected != (getItemCount() - 1)))
new_selected = getItemCount() - 1; new_selected = getItemCount() - 1;
else if (((getItemCount() / listmaxshow) + 1) * listmaxshow == getItemCount() + listmaxshow) // last page has full entries else if (((getItemCount() / listmaxshow) + 1) * listmaxshow == getItemCount() + listmaxshow) // last page has full entries
new_selected = 0; new_selected = 0;