listbox and upnpbrowser: fix pagedown logic

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

Origin message was:
------------------
- listbox and upnpbrowser: fix pagedown logic
This commit is contained in:
vanhofen
2015-11-08 19:46:35 +01:00
parent d1753c3f2c
commit fce301541b
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 new_selected = m_selecteddevice + step;
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;
else if (((m_devices.size() / m_listmaxshow) + 1) * m_listmaxshow == m_devices.size() + m_listmaxshow) // last page has full entries
new_selected = 0;