mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Changes in recmenu.c
This commit is contained in:
parent
82e404a74e
commit
763f9d4e52
29
recmenu.c
29
recmenu.c
@ -55,24 +55,28 @@ int cRecMenu::CalculateOptimalWidth(void) {
|
||||
|
||||
bool cRecMenu::CalculateHeight(bool reDraw) {
|
||||
int newHeight = 2 * border;
|
||||
if (header)
|
||||
bool returnvalue = false;
|
||||
if (header) {
|
||||
newHeight += headerHeight;
|
||||
}
|
||||
for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) {
|
||||
newHeight += (*item)->GetHeight();
|
||||
}
|
||||
if (footer)
|
||||
if (footer) {
|
||||
newHeight += footerHeight;
|
||||
}
|
||||
|
||||
y = (geoManager.osdHeight - newHeight) / 2;
|
||||
|
||||
if (newHeight != height) {
|
||||
height = newHeight;
|
||||
returnvalue = true;
|
||||
}
|
||||
if (scrollable && !reDraw) {
|
||||
width += scrollbarWidth + border;
|
||||
returnvalue = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return returnvalue;
|
||||
}
|
||||
|
||||
void cRecMenu::CreatePixmap(void) {
|
||||
@ -141,7 +145,6 @@ void cRecMenu::InitMenu(bool complete) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) {
|
||||
item->Show();
|
||||
if (!inFront)
|
||||
@ -153,7 +156,7 @@ void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) {
|
||||
bool cRecMenu::AddMenuItemInitial(cRecMenuItem *item, bool inFront) {
|
||||
currentHeight += item->GetHeight();
|
||||
int totalHeight = headerHeight + footerHeight + currentHeight + 2*border;
|
||||
if (totalHeight >= geoManager.osdHeight - 10) {
|
||||
if (totalHeight >= geoManager.osdHeight - 80) {
|
||||
scrollable = true;
|
||||
currentHeight -= item->GetHeight();
|
||||
if (deleteMenuItems) {
|
||||
@ -434,14 +437,16 @@ void cRecMenu::JumpBegin(void) {
|
||||
if (currentItem >= numItems)
|
||||
break;
|
||||
}
|
||||
Arrange(true);
|
||||
if (CalculateHeight(true))
|
||||
CreatePixmap();
|
||||
Arrange(false);
|
||||
startIndex = 0;
|
||||
stopIndex = numItems - 1;
|
||||
cRecMenuItem *first = menuItems.front();
|
||||
first->setActive();
|
||||
first->setBackground();
|
||||
first->Draw();
|
||||
Display(true);
|
||||
Display(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -480,7 +485,9 @@ void cRecMenu::JumpEnd(void) {
|
||||
if (itemsAdded >= numItems)
|
||||
break;
|
||||
}
|
||||
Arrange(true);
|
||||
if (CalculateHeight(true))
|
||||
CreatePixmap();
|
||||
Arrange(false);
|
||||
stopIndex = totalNumItems;
|
||||
startIndex = stopIndex - numItems;
|
||||
if (footer) {
|
||||
@ -493,7 +500,7 @@ void cRecMenu::JumpEnd(void) {
|
||||
last->setBackground();
|
||||
last->Draw();
|
||||
}
|
||||
Display(true);
|
||||
Display(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user