mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Correct view of vdr's switchtimer
This commit is contained in:
parent
f592012442
commit
8f1f2dea33
22
epggrid.c
22
epggrid.c
@ -40,7 +40,7 @@ void cEpgGrid::PositionPixmap() {
|
|||||||
y0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
|
y0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
|
||||||
}
|
}
|
||||||
if (!pixmap) {
|
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));
|
cRect(0, 0, geoManager.colWidth, Duration()/60*geoManager.minutePixel));
|
||||||
} else {
|
} else {
|
||||||
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
|
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
|
||||||
@ -52,7 +52,7 @@ void cEpgGrid::PositionPixmap() {
|
|||||||
x0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
|
x0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
|
||||||
}
|
}
|
||||||
if (!pixmap) {
|
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));
|
cRect(0, 0, Duration()/60*geoManager.minutePixel, geoManager.rowHeight));
|
||||||
} else {
|
} else {
|
||||||
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight ));
|
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);
|
pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, fontManager.FontGridHorizontal);
|
||||||
}
|
}
|
||||||
if (hasSwitchTimer)
|
if (hasSwitchTimer)
|
||||||
drawIcon("Switch", theme.Color(clrButtonYellow));
|
drawIcon("Switch", theme.Color(clrButtonYellow));
|
||||||
if (hasTimer) {
|
if (hasTimer) {
|
||||||
const cTimer *timer = NULL;
|
const cTimer *timer = NULL;
|
||||||
@ -161,8 +161,10 @@ void cEpgGrid::drawText() {
|
|||||||
#ifdef USE_SWITCHONLY
|
#ifdef USE_SWITCHONLY
|
||||||
if (timer->HasFlags(tfSwitchOnly))
|
if (timer->HasFlags(tfSwitchOnly))
|
||||||
drawIcon("Switch", theme.Color(clrButtonYellow));
|
drawIcon("Switch", theme.Color(clrButtonYellow));
|
||||||
#endif /* SWITCHONLY */
|
|
||||||
else if (timer->HasFlags(tfActive))
|
else if (timer->HasFlags(tfActive))
|
||||||
|
#else /* SWITCHONLY */
|
||||||
|
if (timer->HasFlags(tfActive))
|
||||||
|
#endif /* SWITCHONLY */
|
||||||
drawIcon("REC", theme.Color(clrButtonRed));
|
drawIcon("REC", theme.Color(clrButtonRed));
|
||||||
else
|
else
|
||||||
drawIcon("REC", theme.Color(clrButtonGreen));
|
drawIcon("REC", theme.Color(clrButtonGreen));
|
||||||
@ -170,14 +172,14 @@ void cEpgGrid::drawText() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cEpgGrid::drawIcon(cString iconText, tColor color) {
|
void cEpgGrid::drawIcon(cString iconText, tColor color) {
|
||||||
|
|
||||||
const cFont *font = (tvguideConfig.displayMode == eVertical)
|
const cFont *font = (tvguideConfig.displayMode == eVertical)
|
||||||
?fontManager.FontGrid
|
?fontManager.FontGrid
|
||||||
:fontManager.FontGridHorizontalSmall;
|
:fontManager.FontGridHorizontalSmall;
|
||||||
int textWidth = font->Width(*iconText)+2*borderWidth;
|
int textWidth = font->Width(*iconText)+2*borderWidth;
|
||||||
int textHeight = font->Height()+10;
|
int textHeight = font->Height()+10;
|
||||||
pixmap->DrawRectangle( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color);
|
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) {
|
cString cEpgGrid::getTimeString(void) {
|
||||||
@ -185,11 +187,11 @@ cString cEpgGrid::getTimeString(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cEpgGrid::debug() {
|
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(),
|
column->Name(),
|
||||||
*(event->GetTimeString()),
|
*(event->GetTimeString()),
|
||||||
event->Title(),
|
event->Title(),
|
||||||
viewportHeight,
|
viewportHeight,
|
||||||
event->Duration()/60,
|
event->Duration()/60,
|
||||||
active);
|
active);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user