Optical changes in favorites and searchtimer menu

This commit is contained in:
kamel5 2019-04-26 11:15:08 +02:00
parent 5df21a4707
commit 8b1651401c
1 changed files with 11 additions and 11 deletions

View File

@ -1810,13 +1810,13 @@ cRecMenuItemEvent::~cRecMenuItemEvent(void) {
void cRecMenuItemEvent::SetPixmaps(void) { void cRecMenuItemEvent::SetPixmaps(void) {
if (!pixmap) { if (!pixmap) {
pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height)); pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height));
pixmapText = osdManager.requestPixmap(5, cRect(x, y, width, height)); pixmapText = osdManager.requestPixmap(5, cRect(x, y, width - height / 2 - 10, height));
pixmapText->Fill(clrTransparent); pixmapText->Fill(clrTransparent);
pixmapIcons = osdManager.requestPixmap(6, cRect(x, y, width, height)); pixmapIcons = osdManager.requestPixmap(6, cRect(x, y, width, height));
pixmapIcons->Fill(clrTransparent); pixmapIcons->Fill(clrTransparent);
} else { } else {
pixmap->SetViewPort(cRect(x, y, width, height)); pixmap->SetViewPort(cRect(x, y, width, height));
pixmapText->SetViewPort(cRect(x, y, width, height)); pixmapText->SetViewPort(cRect(x, y, width - height / 2 - 10, height));
pixmapIcons->SetViewPort(cRect(x, y, width, height)); pixmapIcons->SetViewPort(cRect(x, y, width, height));
} }
} }
@ -1869,7 +1869,7 @@ int cRecMenuItemEvent::DrawIcons(void) {
int iconY = (height - iconSize) / 2; int iconY = (height - iconSize) / 2;
std::string iconInfo; std::string iconInfo;
if (active) { if (active) {
iconInfo = (iconActive==0)?"info_active":"info_inactive"; iconInfo = (iconActive == 0) ? "info_active" : "info_inactive";
} else { } else {
iconInfo = "info_inactive"; iconInfo = "info_inactive";
} }
@ -1879,7 +1879,6 @@ int cRecMenuItemEvent::DrawIcons(void) {
iconsX += iconSize + 5; iconsX += iconSize + 5;
} }
iconY = height - iconSize - 10;
if (event->HasTimer()) { if (event->HasTimer()) {
cImage *imgHasTimer = imgCache.GetIcon("activetimer", iconSize, iconSize); cImage *imgHasTimer = imgCache.GetIcon("activetimer", iconSize, iconSize);
if (imgHasTimer) { if (imgHasTimer) {
@ -2694,18 +2693,19 @@ void cRecMenuItemSearchTimer::SetPixmaps(void) {
void cRecMenuItemSearchTimer::Draw(void) { void cRecMenuItemSearchTimer::Draw(void) {
int textX = DrawIcons(); int textX = DrawIcons();
bool timerIsActive = timer.IsActive();
pixmapText->Fill(clrTransparent); pixmapText->Fill(clrTransparent);
textX += 20; textX += 20;
cString label; cString label = cString::sprintf("\"%s\"", timer.GetSearchString().c_str());
if (timer.Active()) { cString inactive = cString::sprintf("(%s)", tr("inactive"));
label = cString::sprintf("\"%s\"", timer.SearchString().c_str());
} else {
label = cString::sprintf("\"%s\" (%s)", timer.SearchString().c_str(), tr("inactive"));
}
int numTimersActive = timer.GetNumTimers(); int numTimersActive = timer.GetNumTimers();
int numRecordings = timer.GetNumRecordings(); int numRecordings = timer.GetNumRecordings();
cString info = cString::sprintf("%s: %d, %s: %d", tr("active timers"), numTimersActive, tr("recordings done"), numRecordings); 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, 5 + (height/2 - font->Height()) / 2), *label, colorText, clrTransparent, font);
if (!timerIsActive) {
pixmapText->DrawText(cPoint(textX, 5 + (height - font->Height()) / 2), *inactive, colorText, clrTransparent, font, width - textX - 20, 0, taRight);
}
pixmapText->DrawText(cPoint(textX, height/2 + (height/2 - fontSmall->Height())/2), *info, colorText, clrTransparent, fontSmall); pixmapText->DrawText(cPoint(textX, height/2 + (height/2 - fontSmall->Height())/2), *info, colorText, clrTransparent, fontSmall);
} }