From 2a7a011055a44516ec981e525776394a8c04dcfe Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 9 Jul 2013 00:17:42 +0200 Subject: Version 0.0.6 --- epggrid.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'epggrid.c') diff --git a/epggrid.c b/epggrid.c index 97a57f8..434a612 100644 --- a/epggrid.c +++ b/epggrid.c @@ -7,6 +7,9 @@ cEpgGrid::cEpgGrid(cChannelColumn *c, const cEvent *event) : cGrid(c) { hasTimer = false; if (column->HasTimer()) hasTimer = event->HasTimer(); + hasSwitchTimer = false; + if (column->HasSwitchTimer()) + hasSwitchTimer = SwitchTimers.EventInSwitchList(event); dummy = false; } @@ -89,8 +92,6 @@ void cEpgGrid::drawText() { pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), colorText, colorTextBack, tvguideConfig.FontGridSmall); } } - if (hasTimer) - drawRecIcon(); } else if (tvguideConfig.displayMode == eHorizontal) { if (Width()/tvguideConfig.minutePixel < 10) { int titleY = (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontal->Height())/2; @@ -107,14 +108,21 @@ void cEpgGrid::drawText() { } pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, tvguideConfig.FontGridHorizontal); } + if (hasSwitchTimer) + drawIcon("Switch", theme.Color(clrButtonYellow)); + if (hasTimer) + drawIcon("REC", theme.Color(clrButtonRed)); } -void cEpgGrid::drawRecIcon() { - cString recIconText("REC"); - int width = tvguideConfig.FontGrid->Width(*recIconText)+2*borderWidth; - int height = tvguideConfig.FontGrid->Height()+10; - pixmap->DrawRectangle( cRect(Width() - width - borderWidth, Height() - height - borderWidth, width, height), theme.Color(clrButtonRed)); - pixmap->DrawText(cPoint(Width() - width, Height() - height - borderWidth/2), *recIconText, theme.Color(clrFont), theme.Color(clrButtonRed), tvguideConfig.FontGrid); +void cEpgGrid::drawIcon(cString iconText, tColor color) { + + const cFont *font = (tvguideConfig.displayMode == eVertical) + ?tvguideConfig.FontGrid + :tvguideConfig.FontGridHorizontalSmall; + int textWidth = font->Width(*iconText)+2*borderWidth; + int textHeight = font->Height()+10; + pixmap->DrawRectangle( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color); + pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth/2), *iconText, theme.Color(clrFont), color, font); } cString cEpgGrid::getTimeString(void) { -- cgit v1.2.3