From b5d09ecdba2092e0c2b3370d0fbd2b5b87cbcaf7 Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 9 Nov 2013 16:26:19 +0100 Subject: Fixed editing of text if text is scrolling --- HISTORY | 1 + displaymenu.c | 2 ++ menuitem.c | 21 +++++++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 5c8aade..cf3bd44 100644 --- a/HISTORY +++ b/HISTORY @@ -361,3 +361,4 @@ Version 0.1.4 - size of channel logos in main menu timers display configurable as percent of timer width - Added theme dependend background for status icon in displayreplay +- Fixed editing of text if text is scrolling (closes Bug 1572) diff --git a/displaymenu.c b/displaymenu.c index c0bbd0a..d7e17bb 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -601,6 +601,8 @@ void cNopacityDisplayMenu::SetItem(const char *Text, int Index, bool Current, bo if (item) { item->SetTabs(strItems, tabItems, MaxTabs); item->SetCurrent(Current); + if ((MenuCategory() != mcMain) && (MenuCategory() != mcSetup)) + item->CheckScrollable(false); item->Render(); } } diff --git a/menuitem.c b/menuitem.c index ef5bd67..1dad2cc 100644 --- a/menuitem.c +++ b/menuitem.c @@ -152,6 +152,8 @@ void cNopacityMenuItem::Action(void) { FrameTime = 30; else if (config.GetValue("menuScrollSpeed") == 3) FrameTime = 15; + if (!Running()) + return; int maxX = pixmapTextScroller->DrawPort().Width() - pixmapTextScroller->ViewPort().Width(); bool doSleep = false; while (Running()) { @@ -159,6 +161,8 @@ void cNopacityMenuItem::Action(void) { DoSleep(scrollDelay); doSleep = false; } + if (!Running()) + return; uint64_t Now = cTimeMs::Now(); cPixmap::Lock(); drawPortX = pixmapTextScroller->DrawPort().X(); @@ -1504,6 +1508,7 @@ void cNopacityDefaultMenuItem::SetTextShort(void) { int cNopacityDefaultMenuItem::CheckScrollable(bool hasIcon) { if (!selectable) return 0; + scrollable = false; int colWidth = 0; int colTextWidth = 0; for (int i=0; iCreatePixmap(4, cRect(left + tabWidth[scrollCol], top + index * (height + spaceMenu), tabWidth[scrollCol+numTabs], height), cRect(0, 0, colTextWidth+10, height)); - pixmapTextScroller->Fill(clrTransparent); + if (!pixmapTextScroller) { + pixmapTextScroller = osd->CreatePixmap(4, cRect(left + tabWidth[scrollCol], top + index * (height + spaceMenu), tabWidth[scrollCol+numTabs], height), cRect(0, 0, colTextWidth+10, height)); + pixmapTextScroller->Fill(clrTransparent); + } + } else { + if (pixmapTextScroller) { + while (Running()) { + Cancel(-1); + DoSleep(10); + } + osd->DestroyPixmap(pixmapTextScroller); + pixmapTextScroller = NULL; + scrollCol = -1; + } } return 0; } -- cgit v1.2.3