From 8f1f2dea33f8b14791df1c6ad7e0145b8c08b817 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Sun, 1 Apr 2018 12:09:13 +0200 Subject: [PATCH] Correct view of vdr's switchtimer --- epggrid.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/epggrid.c b/epggrid.c index 47768fe..9b296b7 100644 --- a/epggrid.c +++ b/epggrid.c @@ -40,7 +40,7 @@ void cEpgGrid::PositionPixmap() { y0 += (StartTime() - column->Start())/60*geoManager.minutePixel; } if (!pixmap) { - pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight), + pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight), cRect(0, 0, geoManager.colWidth, Duration()/60*geoManager.minutePixel)); } else { pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight)); @@ -52,7 +52,7 @@ void cEpgGrid::PositionPixmap() { x0 += (StartTime() - column->Start())/60*geoManager.minutePixel; } if (!pixmap) { - pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight), + pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight), cRect(0, 0, Duration()/60*geoManager.minutePixel, geoManager.rowHeight)); } else { pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight )); @@ -151,7 +151,7 @@ void cEpgGrid::drawText() { } pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, fontManager.FontGridHorizontal); } - if (hasSwitchTimer) + if (hasSwitchTimer) drawIcon("Switch", theme.Color(clrButtonYellow)); if (hasTimer) { const cTimer *timer = NULL; @@ -161,8 +161,10 @@ void cEpgGrid::drawText() { #ifdef USE_SWITCHONLY if (timer->HasFlags(tfSwitchOnly)) drawIcon("Switch", theme.Color(clrButtonYellow)); -#endif /* SWITCHONLY */ else if (timer->HasFlags(tfActive)) +#else /* SWITCHONLY */ + if (timer->HasFlags(tfActive)) +#endif /* SWITCHONLY */ drawIcon("REC", theme.Color(clrButtonRed)); else drawIcon("REC", theme.Color(clrButtonGreen)); @@ -170,14 +172,14 @@ void cEpgGrid::drawText() { } void cEpgGrid::drawIcon(cString iconText, tColor color) { - + const cFont *font = (tvguideConfig.displayMode == eVertical) ?fontManager.FontGrid :fontManager.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); + pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth/2), *iconText, theme.Color(clrFont), color, font); } cString cEpgGrid::getTimeString(void) { @@ -185,11 +187,11 @@ cString cEpgGrid::getTimeString(void) { } void cEpgGrid::debug() { - esyslog("tvguide epggrid: %s: %s, %s, viewportHeight: %d px, Duration: %d min, active: %d", + esyslog("tvguide epggrid: %s: %s, %s, viewportHeight: %d px, Duration: %d min, active: %d", column->Name(), - *(event->GetTimeString()), - event->Title(), - viewportHeight, + *(event->GetTimeString()), + event->Title(), + viewportHeight, event->Duration()/60, active); }