From 06ed8b3567bee43f47659b17baf084fed352ddb4 Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 28 Dec 2013 14:01:03 +0100 Subject: [PATCH] Fixed some issues with text backgrounds in flat themes (closes Tickets 1480 and 1486) --- HISTORY | 2 ++ recmenuitem.c | 32 +++++++++++++++++++------------- recmenuitem.h | 1 + recmenumanager.c | 2 ++ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/HISTORY b/HISTORY index be50ba6..c6efb1a 100644 --- a/HISTORY +++ b/HISTORY @@ -94,3 +94,5 @@ Version 1.1.0 - Added Event Short Text (if available) to RecName (Closes Ticket 1490) - Fixed OSD Background Color (Closes Ticket 1474) - Rounded Corners for color buttons (Closes Ticket 1475) +- Fixed some issues with text backgrounds in flat themes (closes + Tickets 1480 and 1486) diff --git a/recmenuitem.c b/recmenuitem.c index 76d0a5f..1e21a1e 100644 --- a/recmenuitem.c +++ b/recmenuitem.c @@ -154,23 +154,27 @@ void cRecMenuItemButtonYesNo::setBackground() { if (tvguideConfig.style == eStyleGraphical) { drawBackgroundGraphical(bgButton, yesActive&&active); colorTextBack = clrTransparent; + colorTextNoBack = clrTransparent; colorText = (active&&yesActive)?theme.Color(clrFontActive):theme.Color(clrFont); colorTextNo = (active&&!yesActive)?theme.Color(clrFontActive):theme.Color(clrFont); pixmapNo->drawBackgroundGraphical(bgButton, active&&!yesActive); } else { + tColor colorNoBack; if (active) { if (yesActive) { color = theme.Color(clrHighlight); colorBlending = theme.Color(clrHighlightBlending); colorText = theme.Color(clrFontActive); - pixmapNo->setColor( theme.Color(clrGrid1), + colorNoBack = theme.Color(clrGrid1); + pixmapNo->setColor( colorNoBack, theme.Color(clrGrid1Blending)); colorTextNo = theme.Color(clrFont); } else { color = theme.Color(clrGrid1); colorBlending = theme.Color(clrGrid1Blending); colorText = theme.Color(clrFont); - pixmapNo->setColor( theme.Color(clrHighlight), + colorNoBack = theme.Color(clrHighlight); + pixmapNo->setColor( colorNoBack, theme.Color(clrHighlightBlending)); colorTextNo = theme.Color(clrFontActive); } @@ -178,11 +182,13 @@ void cRecMenuItemButtonYesNo::setBackground() { color = theme.Color(clrGrid1); colorBlending = theme.Color(clrGrid1Blending); colorText = theme.Color(clrFont); - pixmapNo->setColor( theme.Color(clrGrid1), + colorNoBack = theme.Color(clrGrid1); + pixmapNo->setColor( colorNoBack, theme.Color(clrGrid1Blending)); colorTextNo = theme.Color(clrFont); } colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; + colorTextNoBack = (tvguideConfig.style == eStyleFlat)?colorNoBack:clrTransparent; drawBackground(); drawBorder(); pixmapNo->drawBackground(); @@ -194,8 +200,8 @@ void cRecMenuItemButtonYesNo::Draw(void) { int textYesX = (pixmap->ViewPort().Width() - font->Width(*textYes)) / 2; int textNoX = (pixmapNo->Width() - font->Width(*textNo)) / 2; int textY = (height - font->Height()) / 2; - pixmap->DrawText(cPoint(textYesX, textY), *textYes, colorText, clrTransparent, font); - pixmapNo->DrawText(cPoint(textNoX, textY), *textNo, colorTextNo, clrTransparent, font); + pixmap->DrawText(cPoint(textYesX, textY), *textYes, colorText, colorTextBack, font); + pixmapNo->DrawText(cPoint(textNoX, textY), *textNo, colorTextNo, colorTextNoBack, font); } eRecMenuState cRecMenuItemButtonYesNo::ProcessKey(eKeys Key) { @@ -1383,9 +1389,9 @@ void cRecMenuItemTimer::Draw(void) { cString timeEnd = TimeString(timer->StopTime()); cString timerTime = cString::sprintf("%s - %s", *timeStart, *timeEnd); cString channelInfo = cString::sprintf("%s, %s %d", *channelName, tr("Transp."), channelTransponder); - pixmap->DrawText(cPoint(textX, textHeightLine1), *timerTitle, theme.Color(clrFont), clrTransparent, font); - pixmap->DrawText(cPoint(textX, textHeightLine2), *timerTime, theme.Color(clrFont), clrTransparent, fontSmall); - pixmap->DrawText(cPoint(textX, textHeightLine3), *channelInfo, theme.Color(clrFont), clrTransparent, fontSmall); + pixmap->DrawText(cPoint(textX, textHeightLine1), *timerTitle, theme.Color(clrFont), colorTextBack, font); + pixmap->DrawText(cPoint(textX, textHeightLine2), *timerTime, theme.Color(clrFont), colorTextBack, fontSmall); + pixmap->DrawText(cPoint(textX, textHeightLine3), *channelInfo, theme.Color(clrFont), colorTextBack, fontSmall); DrawTimerConflict(); } @@ -1523,7 +1529,7 @@ void cRecMenuItemTimerConflictHeader::Draw(void) { cString headerText = tr("Timer Conflict"); int xHeader = (xConfl - font->Width(*headerText)) / 2; int yHeader = (height - font->Height()) / 2; - pixmap->DrawText(cPoint(xHeader, yHeader), *headerText, theme.Color(clrFont), clrTransparent, font); + pixmap->DrawText(cPoint(xHeader, yHeader), *headerText, theme.Color(clrFont), colorTextBack, font); pixmap->DrawRectangle(cRect(xConfl, 0, widthConfl, height), theme.Color(clrRecMenuTimerConflictBackground)); @@ -1544,10 +1550,10 @@ void cRecMenuItemTimerConflictHeader::Draw(void) { int xConflStop = width - fontSmall->Width(*strConflStop) - 2; int xOverlapStart = xOverlap - fontSmall->Width(*strOverlapStart) - 2; int xOverlapStop = xOverlap + widthOverlap + 2; - pixmap->DrawText(cPoint(xConflStart, y1), *strConflStart, theme.Color(clrRecMenuTimerConflictBar), clrTransparent, fontSmall); - pixmap->DrawText(cPoint(xConflStop, y1), *strConflStop, theme.Color(clrRecMenuTimerConflictBar), clrTransparent, fontSmall); - pixmap->DrawText(cPoint(xOverlapStart, y2), *strOverlapStart, theme.Color(clrRecMenuTimerConflictOverlap), clrTransparent, fontSmall); - pixmap->DrawText(cPoint(xOverlapStop, y2), *strOverlapStop, theme.Color(clrRecMenuTimerConflictOverlap), clrTransparent, fontSmall); + pixmap->DrawText(cPoint(xConflStart, y1), *strConflStart, theme.Color(clrRecMenuTimerConflictBar), colorTextBack, fontSmall); + pixmap->DrawText(cPoint(xConflStop, y1), *strConflStop, theme.Color(clrRecMenuTimerConflictBar), colorTextBack, fontSmall); + pixmap->DrawText(cPoint(xOverlapStart, y2), *strOverlapStart, theme.Color(clrRecMenuTimerConflictOverlap), colorTextBack, fontSmall); + pixmap->DrawText(cPoint(xOverlapStop, y2), *strOverlapStop, theme.Color(clrRecMenuTimerConflictOverlap), colorTextBack, fontSmall); } // --- cRecMenuItemEvent ------------------------------------------------------- diff --git a/recmenuitem.h b/recmenuitem.h index 431b74e..99022d5 100644 --- a/recmenuitem.h +++ b/recmenuitem.h @@ -121,6 +121,7 @@ private: bool yesActive; cStyledPixmap *pixmapNo; tColor colorTextNo; + tColor colorTextNoBack; public: cRecMenuItemButtonYesNo(cString textYes, cString textNo, diff --git a/recmenumanager.c b/recmenumanager.c index 270165e..20b7ee8 100644 --- a/recmenumanager.c +++ b/recmenumanager.c @@ -123,6 +123,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { if (ev) { activeMenu->Hide(); detailView = new cDetailView(ev); + detailView->setContent(); detailView->drawHeader(); detailView->drawContent(); detailView->drawScrollbar(); @@ -410,6 +411,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { if (ev) { activeMenu->Hide(); detailView = new cDetailView(ev); + detailView->setContent(); detailView->drawHeader(); detailView->drawContent(); detailView->drawScrollbar();