mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
gui/widget/listframe: change page-up/-down scrolling behaviour
This commit is contained in:
@@ -584,15 +584,22 @@ void CListFrame::scrollPageDown(const int pages)
|
|||||||
if(m_nCurrentPage + pages < m_nNrOfPages)
|
if(m_nCurrentPage + pages < m_nNrOfPages)
|
||||||
{
|
{
|
||||||
m_nCurrentPage += pages;
|
m_nCurrentPage += pages;
|
||||||
|
m_nCurrentLine += pages * m_nLinesPerPage;
|
||||||
|
m_nSelectedLine += pages * m_nLinesPerPage;
|
||||||
|
if(m_nSelectedLine >= m_nNrOfLines - 1)
|
||||||
|
m_nSelectedLine = m_nNrOfLines - 1;
|
||||||
|
}
|
||||||
|
else if (m_nSelectedLine == m_nNrOfLines - 1)
|
||||||
|
{
|
||||||
|
m_nCurrentPage = 0;
|
||||||
|
m_nCurrentLine = 0;
|
||||||
|
m_nSelectedLine = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_nCurrentPage = m_nNrOfPages - 1;
|
m_nCurrentPage = m_nNrOfPages - 1;
|
||||||
}
|
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
m_nSelectedLine = m_nNrOfLines - 1;
|
||||||
if(m_nSelectedLine < m_nCurrentLine || m_nSelectedLine -m_nCurrentLine >= m_nLinesPerPage )
|
|
||||||
{
|
|
||||||
m_nSelectedLine = m_nCurrentLine;
|
|
||||||
}
|
}
|
||||||
//TRACE("[CListFrame] m_nCurrentLine: %d, m_nCurrentPage: %d \r\n",m_nCurrentLine,m_nCurrentPage);
|
//TRACE("[CListFrame] m_nCurrentLine: %d, m_nCurrentPage: %d \r\n",m_nCurrentLine,m_nCurrentPage);
|
||||||
refresh();
|
refresh();
|
||||||
@@ -605,18 +612,25 @@ void CListFrame::scrollPageUp(const int pages)
|
|||||||
if( !(m_nMode & SCROLL)) return;
|
if( !(m_nMode & SCROLL)) return;
|
||||||
if( m_nNrOfLines <= 1) return;
|
if( m_nNrOfLines <= 1) return;
|
||||||
|
|
||||||
if(m_nCurrentPage - pages > 0)
|
if(m_nCurrentPage - pages > -1)
|
||||||
{
|
{
|
||||||
m_nCurrentPage -= pages;
|
m_nCurrentPage -= pages;
|
||||||
|
m_nCurrentLine -= pages * m_nLinesPerPage;
|
||||||
|
m_nSelectedLine -= pages * m_nLinesPerPage;
|
||||||
|
if(m_nSelectedLine < 0)
|
||||||
|
m_nSelectedLine = 0;
|
||||||
|
}
|
||||||
|
else if (m_nSelectedLine == 0)
|
||||||
|
{
|
||||||
|
m_nCurrentPage = m_nNrOfPages - 1;
|
||||||
|
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||||
|
m_nSelectedLine = m_nNrOfLines - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_nCurrentPage = 0;
|
m_nCurrentPage = 0;
|
||||||
}
|
m_nCurrentLine = 0;
|
||||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
m_nSelectedLine = 0;
|
||||||
if(m_nSelectedLine < m_nCurrentLine || m_nSelectedLine - m_nCurrentLine >= m_nLinesPerPage )
|
|
||||||
{
|
|
||||||
m_nSelectedLine = m_nCurrentLine;
|
|
||||||
}
|
}
|
||||||
//TRACE("[CListFrame] m_nCurrentLine: %d, m_nCurrentPage: %d \r\n",m_nCurrentLine,m_nCurrentPage);
|
//TRACE("[CListFrame] m_nCurrentLine: %d, m_nCurrentPage: %d \r\n",m_nCurrentLine,m_nCurrentPage);
|
||||||
refresh();
|
refresh();
|
||||||
|
Reference in New Issue
Block a user