Fixes for non-standart icon sizes. Not complete yet, work in progress. Probably will broke commit #568

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@569 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 56674d5561
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-05-06 (Thu, 06 May 2010)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2010-05-06 09:39:29 +00:00
parent 78dadc3caf
commit 580c62e82b
38 changed files with 678 additions and 354 deletions

View File

@@ -181,9 +181,18 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/)
step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1
selected -= step;
if((prev_selected-step) < 0) {
if(prev_selected != 0 && step != 1)
selected = 0;
else
selected = getItemCount() - 1;
}
#if 0
if((prev_selected-step) < 0) // because of uint
selected = getItemCount() - 1;
#endif
paintItem(prev_selected - liststart);
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
@@ -198,17 +207,28 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/)
{
if(getItemCount()!=0) {
unsigned int step = 0;
int prev_selected = selected;
unsigned int prev_selected = selected;
step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1
selected += step;
if(selected >= getItemCount()) {
if((getItemCount() - listmaxshow -1 < prev_selected) && (prev_selected != (getItemCount() - 1)) && (step != 1))
selected = getItemCount() - 1;
else if (((getItemCount() / listmaxshow) + 1) * listmaxshow == getItemCount() + listmaxshow) // last page has full entries
selected = 0;
else
selected = ((step == listmaxshow) && (selected < (((getItemCount() / listmaxshow)+1) * listmaxshow))) ? (getItemCount() - 1) : 0;
}
#if 0
if(selected >= getItemCount()) {
if (((getItemCount() / listmaxshow) + 1) * listmaxshow == getItemCount() + listmaxshow) // last page has full entries
selected = 0;
else
selected = ((step == listmaxshow) && (selected < (((getItemCount() / listmaxshow) + 1) * listmaxshow))) ? (getItemCount() - 1) : 0;
}
#endif
paintItem(prev_selected - liststart);
unsigned int oldliststart = liststart;