From 26f46355f9fb20b3921d1188c7084dcaa2b838d4 Mon Sep 17 00:00:00 2001 From: louis Date: Mon, 27 Jan 2014 19:14:43 +0100 Subject: [PATCH] fixed bug in diplaying list of search timers --- recmenu.c | 2 +- recmenus.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/recmenu.c b/recmenu.c index 9a9a002..d594f36 100644 --- a/recmenu.c +++ b/recmenu.c @@ -153,7 +153,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) { + if (totalHeight >= geoManager.osdHeight - 10) { scrollable = true; currentHeight -= item->GetHeight(); if (deleteMenuItems) { diff --git a/recmenus.c b/recmenus.c index 94df353..9a8fa41 100644 --- a/recmenus.c +++ b/recmenus.c @@ -654,10 +654,10 @@ cRecMenuSearchTimers::cRecMenuSearchTimers(std::vector sear cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*headline, true); infoItem->CalculateHeight(width - 2 * border); SetHeader(infoItem); - if (numSearchTimers > 0) - SetMenuItems(); cRecMenuItem *button = new cRecMenuItemButton(tr("Close"), rmsClose, (!numSearchTimers)?true:false); SetFooter(button); + if (numSearchTimers > 0) + SetMenuItems(); CalculateHeight(); CreatePixmap(); Arrange(); @@ -669,7 +669,8 @@ cRecMenuSearchTimers::~cRecMenuSearchTimers(void) { void cRecMenuSearchTimers::SetMenuItems(void) { for (int i = 0; i < numSearchTimers; i++) { - AddMenuItemInitial(new cRecMenuItemSearchTimer(searchTimers[i], rmsSearchTimerEdit, rmsSearchTimerDeleteConfirm, rmsSearchTimerTest, (i==0)?true:false)); + if (!AddMenuItemInitial(new cRecMenuItemSearchTimer(searchTimers[i], rmsSearchTimerEdit, rmsSearchTimerDeleteConfirm, rmsSearchTimerTest, (i==0)?true:false))) + break; } }