fixed a bug that some recmenuitems are not redrawn

This commit is contained in:
louis 2014-01-17 15:39:50 +01:00
parent 2c72feabbd
commit 497f95aa6f
2 changed files with 16 additions and 23 deletions

View File

@ -426,7 +426,6 @@ cImage *cImageCache::CreateGrid(int width, int height, bool active) {
tColor *imgData = (tColor *)image->Data(); tColor *imgData = (tColor *)image->Data();
if (w != width || h != height) { if (w != width || h != height) {
ImageScaler scaler; ImageScaler scaler;
//esyslog("tvguide: imagescaler parameters: width %d, height %d, w %d, h %d", width, height, w, h);
scaler.SetImageParameters(imgData, width, width, height, w, h); scaler.SetImageParameters(imgData, width, width, height, w, h);
for (const void *pixels_end = &pixels[w*h]; pixels < pixels_end; ++pixels) for (const void *pixels_end = &pixels[w*h]; pixels < pixels_end; ++pixels)
scaler.PutSourcePixel(pixels->blue / ((MaxRGB + 1) / 256), scaler.PutSourcePixel(pixels->blue / ((MaxRGB + 1) / 256),

View File

@ -2564,22 +2564,19 @@ void cRecMenuItemSearchTimer::SetPixmaps(void) {
void cRecMenuItemSearchTimer::Draw(void) { void cRecMenuItemSearchTimer::Draw(void) {
int textX = DrawIcons(); int textX = DrawIcons();
if (!drawn) { pixmapText->Fill(clrTransparent);
pixmapText->Fill(clrTransparent); textX += 20;
textX += 20; cString label;
cString label; if (timer.Active()) {
if (timer.Active()) { label = cString::sprintf("\"%s\"", timer.SearchString().c_str());
label = cString::sprintf("\"%s\"", timer.SearchString().c_str()); } else {
} else { label = cString::sprintf("\"%s\" (%s)", timer.SearchString().c_str(), tr("inactive"));
label = cString::sprintf("\"%s\" (%s)", timer.SearchString().c_str(), tr("inactive"));
}
int numTimersActive = timer.GetNumTimers();
int numRecordings = timer.GetNumRecordings();
cString info = cString::sprintf("%s: %d, %s: %d", tr("active timers"), numTimersActive, tr("recordings done"), numRecordings);
pixmapText->DrawText(cPoint(textX, 5 + (height/2 - font->Height())/2), *label, colorText, clrTransparent, font);
pixmapText->DrawText(cPoint(textX, height/2 + (height/2 - fontSmall->Height())/2), *info, colorText, clrTransparent, fontSmall);
drawn = true;
} }
int numTimersActive = timer.GetNumTimers();
int numRecordings = timer.GetNumRecordings();
cString info = cString::sprintf("%s: %d, %s: %d", tr("active timers"), numTimersActive, tr("recordings done"), numRecordings);
pixmapText->DrawText(cPoint(textX, 5 + (height/2 - font->Height())/2), *label, colorText, clrTransparent, font);
pixmapText->DrawText(cPoint(textX, height/2 + (height/2 - fontSmall->Height())/2), *info, colorText, clrTransparent, fontSmall);
} }
void cRecMenuItemSearchTimer::Hide(void) { void cRecMenuItemSearchTimer::Hide(void) {
@ -2693,13 +2690,10 @@ void cRecMenuItemFavorite::SetPixmaps(void) {
void cRecMenuItemFavorite::Draw(void) { void cRecMenuItemFavorite::Draw(void) {
int textX = DrawIcons(); int textX = DrawIcons();
if (!drawn) { pixmapText->Fill(clrTransparent);
pixmapText->Fill(clrTransparent); textX += 20;
textX += 20; cString label = cString::sprintf("\"%s\"", favorite.SearchString().c_str());
cString label = cString::sprintf("\"%s\"", favorite.SearchString().c_str()); pixmapText->DrawText(cPoint(textX, (height - fontLarge->Height())/2), *label, colorText, clrTransparent, fontLarge);
pixmapText->DrawText(cPoint(textX, (height - fontLarge->Height())/2), *label, colorText, clrTransparent, fontLarge);
drawn = true;
}
} }
void cRecMenuItemFavorite::Hide(void) { void cRecMenuItemFavorite::Hide(void) {