summaryrefslogtreecommitdiff
path: root/epggrid.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-07-09 00:17:42 +0200
committerlouis <louis.braun@gmx.de>2013-07-09 00:17:42 +0200
commit2a7a011055a44516ec981e525776394a8c04dcfe (patch)
tree55c9828c7b619622ec36da3f4b41318ed6c85ae0 /epggrid.c
parent6da4b610d98cafe7c20555c926359d7f89347c76 (diff)
downloadvdr-plugin-tvguide-2a7a011055a44516ec981e525776394a8c04dcfe.tar.gz
vdr-plugin-tvguide-2a7a011055a44516ec981e525776394a8c04dcfe.tar.bz2
Version 0.0.6
Diffstat (limited to 'epggrid.c')
-rw-r--r--epggrid.c24
1 files changed, 16 insertions, 8 deletions
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) {