Can switch off and optimize diplay time in epggrid "displayMode == Vertical"

This commit is contained in:
kamel5 2019-10-17 13:46:03 +02:00
parent a711aed160
commit 3f0bd75011
2 changed files with 26 additions and 22 deletions

View File

@ -92,12 +92,11 @@ void cEpgGrid::SetSwitchTimer() {
void cEpgGrid::setText() {
if (config.displayMode == eVertical) {
cString strText;
strText = cString::sprintf("%s - %s:\n%s", *(event->GetTimeString()), *(event->GetEndTimeString()), event->Title());
text->Set(*(strText), fontManager.FontGrid, geoManager.colWidth-2*borderWidth);
text->Set(event->Title(), fontManager.FontGrid, geoManager.colWidth - 2 * borderWidth);
extText->Set(event->ShortText(), fontManager.FontGridSmall, geoManager.colWidth - 2 * borderWidth);
} else if (config.displayMode == eHorizontal) {
timeString = cString::sprintf("%s - %s", *(event->GetTimeString()), *(event->GetEndTimeString()));
}
if (config.showTimeInGrid) {
timeString = cString::sprintf("%s - %s:", *(event->GetTimeString()), *(event->GetEndTimeString()));
}
}
@ -114,16 +113,21 @@ void cEpgGrid::drawText() {
if (Height() / geoManager.minutePixel < 6)
return;
int textHeight = fontManager.FontGrid->Height();
int textHeightSmall = fontManager.FontGridSmall->Height();
int textLines = text->Lines();
int titleY = borderWidth;
if (config.showTimeInGrid) { // mit Zeitangabe im Grid
pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridSmall);
titleY += textHeightSmall;
}
for (int i = 0; i < textLines; i++) {
pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, colorTextBack, fontManager.FontGrid);
pixmap->DrawText(cPoint(borderWidth, titleY + i * textHeight), text->GetLine(i), colorText, colorTextBack, fontManager.FontGrid);
}
int extTextLines = extText->Lines();
int offset = (textLines+1)*textHeight - 0.5*textHeight;
textHeight = fontManager.FontGridSmall->Height();
if ((Height()-textHeight-10) > offset) {
int offset = titleY + (textLines + 0.5) * textHeight;
if ((Height() - textHeightSmall - 10) > offset) {
for (int i = 0; i < extTextLines; i++) {
pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), colorText, colorTextBack, fontManager.FontGridSmall);
pixmap->DrawText(cPoint(borderWidth, offset + i * textHeightSmall), extText->GetLine(i), colorText, colorTextBack, fontManager.FontGridSmall);
}
}
} else if (config.displayMode == eHorizontal) {
@ -134,7 +138,7 @@ void cEpgGrid::drawText() {
}
cString strTitle = CutText(event->Title(), viewportHeight, fontManager.FontGridHorizontal).c_str();
int titleY = 0;
if (config.showTimeInGrid) {
if (config.showTimeInGrid) { // mit Zeitangabe im Grid
pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall);
titleY = fontManager.FontGridHorizontalSmall->Height() + (geoManager.rowHeight - fontManager.FontGridHorizontalSmall->Height() - fontManager.FontGridHorizontal->Height()) / 2;
} else {

View File

@ -275,8 +275,8 @@ void cMenuSetupScreenLayout::Set(void) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of Channel Header (Perc. of osd width)")), &tmpConfig->channelHeaderWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of Timeline (Perc. of osd height)")), &tmpConfig->timeLineHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpConfig->channelRows, 3, 12));
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Display time in EPG Grids")), &tmpConfig->showTimeInGrid));
}
Add(new cMenuEditBoolItem(tr("Display time in EPG Grids"), &tmpConfig->showTimeInGrid));
Add(new cMenuEditIntItem(tr("Height of Headers (Status Header and EPG View, Perc. of osd height)"), &tmpConfig->headerHeightPercent, 10, 50));
Add(new cMenuEditIntItem(tr("Height of Footer (Perc. of osd height)"), &tmpConfig->footerHeightPercent, 3, 20));