mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
menu: make page_start[] int, avoids lots of casts
Origin commit data
------------------
Branch: ni/coolstream
Commit: c5760c6a27
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-06-02 (Sun, 02 Jun 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -547,11 +547,11 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
||||
case (CRCInput::RC_page_down) :
|
||||
if(msg==CRCInput::RC_page_up) {
|
||||
if(current_page) {
|
||||
pos = (int) page_start[current_page] - 1;
|
||||
pos = page_start[current_page] - 1;
|
||||
for (unsigned int count=pos ; count > 0; count--) {
|
||||
CMenuItem* item = items[pos];
|
||||
if ( item->isSelectable() ) {
|
||||
if ((pos < (int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page])) {
|
||||
if ((pos < page_start[current_page + 1]) && (pos >= page_start[current_page])) {
|
||||
items[selected]->paint( false );
|
||||
item->paint( true );
|
||||
paintHint(pos);
|
||||
@@ -569,7 +569,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
||||
for (unsigned int count=0; count < items.size(); count++) {
|
||||
CMenuItem* item = items[pos];
|
||||
if ( item->isSelectable() ) {
|
||||
if ((pos < (int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page])) {
|
||||
if ((pos < page_start[current_page + 1]) && (pos >= page_start[current_page])) {
|
||||
items[selected]->paint( false );
|
||||
item->paint( true );
|
||||
paintHint(pos);
|
||||
@@ -585,13 +585,13 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
||||
}
|
||||
}
|
||||
else if(msg==CRCInput::RC_page_down) {
|
||||
pos = (int) page_start[current_page + 1];// - 1;
|
||||
pos = page_start[current_page + 1];// - 1;
|
||||
if(pos >= (int) items.size())
|
||||
pos = items.size()-1;
|
||||
for (unsigned int count=pos ; count < items.size(); count++) {
|
||||
CMenuItem* item = items[pos];
|
||||
if ( item->isSelectable() ) {
|
||||
if ((pos < (int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page])) {
|
||||
if ((pos < page_start[current_page + 1]) && (pos >= page_start[current_page])) {
|
||||
items[selected]->paint( false );
|
||||
item->paint( true );
|
||||
paintHint(pos);
|
||||
@@ -623,7 +623,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
||||
CMenuItem* item = items[pos];
|
||||
|
||||
if ( item->isSelectable() ) {
|
||||
if ((pos < (int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page]))
|
||||
if ((pos < page_start[current_page + 1]) && (pos >= page_start[current_page]))
|
||||
{ // Item is currently on screen
|
||||
//clear prev. selected
|
||||
items[selected]->paint( false );
|
||||
@@ -975,9 +975,9 @@ void CMenuWidget::paintItems()
|
||||
//Item not currently on screen
|
||||
if (selected >= 0)
|
||||
{
|
||||
while(selected < (int)page_start[current_page])
|
||||
while (selected < page_start[current_page])
|
||||
current_page--;
|
||||
while(selected >= (int)page_start[current_page + 1])
|
||||
while (selected >= page_start[current_page + 1])
|
||||
current_page++;
|
||||
}
|
||||
|
||||
@@ -992,7 +992,7 @@ void CMenuWidget::paintItems()
|
||||
}
|
||||
}
|
||||
int ypos=item_start_y;
|
||||
for (unsigned int count = 0; count < items.size(); count++)
|
||||
for (int count = 0; count < (int)items.size(); count++)
|
||||
{
|
||||
CMenuItem* item = items[count];
|
||||
|
||||
|
Reference in New Issue
Block a user