diff options
author | louis <louis.braun@gmx.de> | 2013-11-09 16:26:19 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-11-09 16:26:19 +0100 |
commit | b5d09ecdba2092e0c2b3370d0fbd2b5b87cbcaf7 (patch) | |
tree | caf60d17089bf9689105070f79db15cf0a77eab9 | |
parent | a8b8064916008bc250c6ab550006e5a3560813ae (diff) | |
download | skin-nopacity-b5d09ecdba2092e0c2b3370d0fbd2b5b87cbcaf7.tar.gz skin-nopacity-b5d09ecdba2092e0c2b3370d0fbd2b5b87cbcaf7.tar.bz2 |
Fixed editing of text if text is scrolling
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | displaymenu.c | 2 | ||||
-rw-r--r-- | menuitem.c | 21 |
3 files changed, 22 insertions, 2 deletions
@@ -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(); } } @@ -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; i<numTabs; i++) { @@ -1525,8 +1530,20 @@ int cNopacityDefaultMenuItem::CheckScrollable(bool hasIcon) { break; } if (scrollable) { - 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); + 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; } |