changed event result lists that it is possible to scroll page up and down directly with left / right

This commit is contained in:
louis 2014-02-07 17:57:14 +01:00
parent acb0580522
commit 4b0f4184cf
5 changed files with 35 additions and 50 deletions

View File

@ -124,3 +124,6 @@ Version 1.2.0
- fixed a bug when scrolling page up and the menu footer is active
- order of search timers in search timer list in alphabetical order
- changed order of actions on search timer menu items
- changed event result lists that it is possible to scroll page up and
down directly with left / right. A recording is triggered now with the
red key.

View File

@ -574,6 +574,13 @@ void cRecMenu::Show(void) {
}
}
void cRecMenu::UpdateActiveMenuItem(void) {
cRecMenuItem *activeItem = GetActiveMenuItem();
if (activeItem)
activeItem->Draw();
}
void cRecMenu::DrawScrollBar(void) {
pixmapScrollBar->Fill(theme.Color(clrBorder));
pixmapScrollBar->DrawRectangle(cRect(2,2,pixmapScrollBar->ViewPort().Width()-4, pixmapScrollBar->ViewPort().Height() - 4), theme.Color(clrBackground));

View File

@ -60,6 +60,7 @@ public:
void Display(bool scroll = false);
void Hide(void);
void Show(void);
void UpdateActiveMenuItem(void);
virtual eRecMenuState ProcessKey(eKeys Key);
};
#endif //__TVGUIDE_RECMENU_H

View File

@ -1846,15 +1846,6 @@ void cRecMenuItemEvent::Draw(void) {
pixmapText->DrawText(cPoint(textX, textHeightLine1), *info, colorText, clrTransparent, fontSmall);
pixmapText->DrawText(cPoint(textX, textHeightLine2), *title, colorText, clrTransparent, font);
pixmapText->DrawText(cPoint(textX, textHeightLine3), *desc, colorText, clrTransparent, fontSmall);
if (event->HasTimer()) {
int iconSize = height / 2;
int iconY = (height - iconSize) / 2;
cImage *imgHasTimer = imgCache.GetIcon("activetimer", iconSize, iconSize);
if (imgHasTimer) {
pixmapIcons->DrawImage(cPoint(width - iconSize - 10, iconY), *imgHasTimer);
}
}
}
int cRecMenuItemEvent::DrawIcons(void) {
@ -1862,28 +1853,33 @@ int cRecMenuItemEvent::DrawIcons(void) {
int iconsX = 10;
int iconSize = height / 2;
int iconY = (height - iconSize) / 2;
std::string iconInfo, iconRecord;
std::string iconInfo;
if (active) {
iconInfo = (iconActive==0)?"info_active":"info_inactive";
if (action2 != rmsDisabled)
iconRecord = (iconActive==1)?"record_active":"record_inactive";
} else {
iconInfo = "info_inactive";
if (action2 != rmsDisabled)
iconRecord = "record_inactive";
}
cImage *imgInfo = imgCache.GetIcon(iconInfo, iconSize, iconSize);
if (imgInfo) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgInfo);
iconsX += iconSize + 5;
}
if (action2 != rmsDisabled) {
cImage *imgRec = imgCache.GetIcon(iconRecord, iconSize, iconSize);
if (imgRec) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgRec);
iconsX += iconSize + 5;
iconY = height - iconSize - 10;
if (event->HasTimer()) {
cImage *imgHasTimer = imgCache.GetIcon("activetimer", iconSize, iconSize);
if (imgHasTimer) {
pixmapIcons->DrawImage(cPoint(width - iconSize - 10, iconY), *imgHasTimer);
}
}
} else {
std::string iconRec = active ? "record_active" : "record_inactive";
cImage *imgRec = imgCache.GetIcon(iconRec, iconSize, iconSize);
if (imgRec) {
pixmapIcons->DrawImage(cPoint(width - iconSize - 10, iconY), *imgRec);
}
}
return iconsX;
}
@ -1902,36 +1898,11 @@ void cRecMenuItemEvent::Show(void) {
eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) {
bool consumed = false;
switch (Key & ~k_Repeat) {
case kLeft:
if (action2 == rmsDisabled)
return rmsNotConsumed;
if (iconActive == 1) {
iconActive = 0;
consumed = true;
}
DrawIcons();
if (consumed)
return rmsConsumed;
else
return rmsNotConsumed;
break;
case kRight: {
if (action2 == rmsDisabled)
return rmsNotConsumed;
if (iconActive == 0) {
iconActive = 1;
consumed = true;
}
DrawIcons();
if (consumed)
return rmsConsumed;
else
return rmsNotConsumed;
break; }
case kOk:
if (iconActive == 0)
return action;
else if (iconActive == 1)
return action;
break;
case kRed:
if (!event->HasTimer())
return action2;
break;
default:

View File

@ -544,6 +544,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
delete activeMenu;
activeMenu = activeMenuBuffer;
activeMenuBuffer = NULL;
activeMenu->UpdateActiveMenuItem();
activeMenu->Show();
break;
/**********************************************************************************************
@ -718,6 +719,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
delete activeMenu;
activeMenu = activeMenuBuffer2;
activeMenuBuffer2 = NULL;
activeMenu->UpdateActiveMenuItem();
activeMenu->Show();
break;
case rmsFavoritesNow:
@ -767,6 +769,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
delete activeMenu;
activeMenu = activeMenuBuffer;
activeMenuBuffer = NULL;
activeMenu->UpdateActiveMenuItem();
activeMenu->Show();
state = osContinue;
}
@ -795,7 +798,6 @@ void cRecMenuManager::DisplaySearchTimerList(void) {
delete activeMenu;
std::vector<cTVGuideSearchTimer> searchTimers;
recManager->GetSearchTimers(&searchTimers);
//std::sort(searchTimers.begin(), searchTimers.end());
activeMenu = new cRecMenuSearchTimers(searchTimers);
activeMenu->Display();
}
@ -865,6 +867,7 @@ eOSState cRecMenuManager::ProcessKey(eKeys Key) {
delete activeMenu;
activeMenu = activeMenuBuffer;
activeMenuBuffer = NULL;
activeMenu->UpdateActiveMenuItem();
activeMenu->Show();
state = osContinue;
osdManager.flush();