From 4f93ac2516dacdec5e142aaf60a06c6e1c16daf3 Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 28 May 2013 17:23:33 +0200 Subject: [PATCH] avoided nasty font pixelation effects with theme iceblue --- detailview.c | 12 +++++++----- dummygrid.c | 7 ++++--- epggrid.c | 13 +++++++------ footer.c | 4 ++-- headergrid.c | 6 ++++-- messagebox.c | 2 +- statusheader.c | 9 +++++---- 7 files changed, 30 insertions(+), 23 deletions(-) diff --git a/detailview.c b/detailview.c index 494e163..b014b11 100644 --- a/detailview.c +++ b/detailview.c @@ -69,6 +69,7 @@ void cDetailView::createPixmaps() { void cDetailView::drawHeader() { header->drawBackground(); header->drawBoldBorder(); + tColor colorTextBack = (tvguideConfig.useBlending==0)?theme.Color(clrHeader):clrTransparent; int logoHeight = header->Height() / 2; int logoWidth = logoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; int lineHeight = tvguideConfig.FontDetailHeader->Height(); @@ -93,27 +94,28 @@ void cDetailView::drawHeader() { } int textX = logoDrawn?(20 + logoWidth):20; int textY = (header->Height() - 2*lineHeight)/2; - header->DrawText(cPoint(textX, textY), event->Title(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailHeader); + header->DrawText(cPoint(textX, textY), event->Title(), theme.Color(clrFont), colorTextBack, tvguideConfig.FontDetailHeader); cString datetime = cString::sprintf("%s, %s - %s (%d min)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60); - header->DrawText(cPoint(textX, textY + lineHeight), *datetime, theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailView); - header->DrawText(cPoint(textX, textY + 2 * lineHeight), event->ShortText(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailView); + header->DrawText(cPoint(textX, textY + lineHeight), *datetime, theme.Color(clrFont), colorTextBack, tvguideConfig.FontDetailView); + header->DrawText(cPoint(textX, textY + 2 * lineHeight), event->ShortText(), theme.Color(clrFont), colorTextBack, tvguideConfig.FontDetailView); } void cDetailView::drawContent() { content->Fill(theme.Color(clrBorder)); content->DrawRectangle(cRect(2, 0, content->ViewPort().Width() - 2, content->DrawPort().Height()), theme.Color(clrBackground)); + tColor colorTextBack = (tvguideConfig.useBlending==0)?theme.Color(clrBackground):clrTransparent; int textHeight = tvguideConfig.FontDetailView->Height(); int textLines = description.Lines(); int i=0; for (; iDrawText(cPoint(20, 20 + i*textHeight), description.GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailView); + content->DrawText(cPoint(20, 20 + i*textHeight), description.GetLine(i), theme.Color(clrFont), colorTextBack, tvguideConfig.FontDetailView); } i++; if (tvguideConfig.displayRerunsDetailEPGView) { textLines = reruns.Lines(); for (int j=0; jDrawText(cPoint(20, 20 + i*textHeight), reruns.GetLine(j), theme.Color(clrFont), clrTransparent, tvguideConfig.FontDetailView); + content->DrawText(cPoint(20, 20 + i*textHeight), reruns.GetLine(j), theme.Color(clrFont), colorTextBack, tvguideConfig.FontDetailView); i++; } } diff --git a/dummygrid.c b/dummygrid.c index 85e75b9..f2c5c03 100644 --- a/dummygrid.c +++ b/dummygrid.c @@ -58,23 +58,24 @@ void cDummyGrid::setText() { void cDummyGrid::drawText() { tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont); + tColor colorTextBack = (tvguideConfig.useBlending==0)?color:clrTransparent; if (tvguideConfig.displayMode == eVertical) { if (Height()/tvguideConfig.minutePixel < 6) return; int textHeight = tvguideConfig.FontGrid->Height(); int textLines = text->Lines(); for (int i=0; iDrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, clrTransparent, tvguideConfig.FontGrid); + pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, colorTextBack, tvguideConfig.FontGrid); } } else if (tvguideConfig.displayMode == eHorizontal) { if (Width()/tvguideConfig.minutePixel < 10) { int titleY = (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontal->Height())/2; - pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, clrTransparent, tvguideConfig.FontGridHorizontal); + pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, tvguideConfig.FontGridHorizontal); return; } int titleY = (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontal->Height())/2; - pixmap->DrawText(cPoint(borderWidth, titleY), *strText, colorText, clrTransparent, tvguideConfig.FontGridHorizontal); + pixmap->DrawText(cPoint(borderWidth, titleY), *strText, colorText, colorTextBack, tvguideConfig.FontGridHorizontal); } } cString cDummyGrid::getText(void) { diff --git a/epggrid.c b/epggrid.c index ac6649e..8dfea95 100644 --- a/epggrid.c +++ b/epggrid.c @@ -72,20 +72,21 @@ void cEpgGrid::setText() { void cEpgGrid::drawText() { tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont); + tColor colorTextBack = (tvguideConfig.useBlending==0)?color:clrTransparent; if (tvguideConfig.displayMode == eVertical) { if (Height()/tvguideConfig.minutePixel < 6) return; int textHeight = tvguideConfig.FontGrid->Height(); int textLines = text->Lines(); for (int i=0; iDrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, clrTransparent, tvguideConfig.FontGrid); + pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, colorTextBack, tvguideConfig.FontGrid); } int extTextLines = extText->Lines(); int offset = (textLines+1)*textHeight - 0.5*textHeight; textHeight = tvguideConfig.FontGridSmall->Height(); if ((Height()-textHeight-10) > offset) { for (int i=0; iDrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), colorText, clrTransparent, tvguideConfig.FontGridSmall); + pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), colorText, colorTextBack, tvguideConfig.FontGridSmall); } } if (hasTimer) @@ -93,13 +94,13 @@ void cEpgGrid::drawText() { } else if (tvguideConfig.displayMode == eHorizontal) { if (Width()/tvguideConfig.minutePixel < 10) { int titleY = (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontal->Height())/2; - pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, clrTransparent, tvguideConfig.FontGridHorizontal); + pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, tvguideConfig.FontGridHorizontal); return; } - pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, clrTransparent, tvguideConfig.FontGridHorizontalSmall); + pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, tvguideConfig.FontGridHorizontalSmall); cString strTitle = CutText(event->Title(), viewportHeight, tvguideConfig.FontGridHorizontal).c_str(); int titleY = tvguideConfig.FontGridHorizontalSmall->Height() + (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontalSmall->Height() - tvguideConfig.FontGridHorizontal->Height())/2; - pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, clrTransparent, tvguideConfig.FontGridHorizontal); + pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, tvguideConfig.FontGridHorizontal); } } @@ -108,7 +109,7 @@ void cEpgGrid::drawRecIcon() { 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), clrTransparent, tvguideConfig.FontGrid); + pixmap->DrawText(cPoint(Width() - width, Height() - height - borderWidth/2), *recIconText, theme.Color(clrFont), theme.Color(clrButtonRed), tvguideConfig.FontGrid); } cString cEpgGrid::getTimeString(void) { diff --git a/footer.c b/footer.c index 554f8f1..9e40689 100644 --- a/footer.c +++ b/footer.c @@ -39,7 +39,7 @@ void cFooter::drawBlueButton() { } void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, int num) { - + tColor colorTextBack = (tvguideConfig.useBlending==0)?color:clrTransparent; int left = num * buttonWidth + (num + 1) * buttonBorder; footer->DrawRectangle(cRect(left, buttonY, buttonWidth, buttonHeight), borderColor); if (tvguideConfig.useBlending) { @@ -52,5 +52,5 @@ void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, int } int textWidth = tvguideConfig.FontButton->Width(text); int textHeight = tvguideConfig.FontButton->Height(); - footer->DrawText(cPoint(left + (buttonWidth-textWidth)/2, buttonY + (buttonHeight-textHeight)/2), text, theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton); + footer->DrawText(cPoint(left + (buttonWidth-textWidth)/2, buttonY + (buttonHeight-textHeight)/2), text, theme.Color(clrFontButtons), colorTextBack, tvguideConfig.FontButton); } \ No newline at end of file diff --git a/headergrid.c b/headergrid.c index 11f4b94..06e8b49 100644 --- a/headergrid.c +++ b/headergrid.c @@ -66,9 +66,10 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) { textWidthMax -= logoWidth; } if (drawText) { + tColor colorTextBack = (tvguideConfig.useBlending==0)?color:clrTransparent; cString strChannel = cString::sprintf("%d %s", channel->Number(), channel->Name()); strChannel = CutText(*strChannel, textWidthMax, tvguideConfig.FontChannelHeaderHorizontal).c_str(); - pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontChannelHeaderHorizontal); + pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), colorTextBack, tvguideConfig.FontChannelHeaderHorizontal); } } @@ -99,12 +100,13 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) { } if (!drawText) return; + tColor colorTextBack = (tvguideConfig.useBlending==0)?color:clrTransparent; for (int i=0; iWidth(tw.GetLine(i)); int xText = (tvguideConfig.colWidth - textWidth) / 2; if (xText < 0) xText = 0; - pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontChannelHeader); + pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, tvguideConfig.FontChannelHeader); } } diff --git a/messagebox.c b/messagebox.c index fd7acb9..5d8a6b4 100644 --- a/messagebox.c +++ b/messagebox.c @@ -83,7 +83,7 @@ bool cMessageBox::Start(int displayTime, cString msg) { int textWidth = 0; for (int i=0; iWidth(message.GetLine(i)); - content->DrawText(cPoint((width - textWidth)/2, 20 + i*textHeight), message.GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontMessageBox); + content->DrawText(cPoint((width - textWidth)/2, 20 + i*textHeight), message.GetLine(i), theme.Color(clrFont), theme.Color(clrBackground), tvguideConfig.FontMessageBox); } cPixmap::Unlock(); msgboxThread->Start(); diff --git a/statusheader.c b/statusheader.c index 39610d3..1ba3b49 100644 --- a/statusheader.c +++ b/statusheader.c @@ -51,6 +51,7 @@ void cStatusHeader::ScaleVideo(void) { void cStatusHeader::DrawInfoText(cGrid *grid) { int border = 5; + tColor colorTextBack = (tvguideConfig.useBlending==0)?color:clrTransparent; pixmapText->Fill(clrTransparent); int x = border; int y = border; @@ -61,7 +62,7 @@ void cStatusHeader::DrawInfoText(cGrid *grid) { title = cString::sprintf(": %s", event->Title()); cString header = cString::sprintf("%s%s", *time, *title); header = CutText(*header, pixmapText->ViewPort().Width() - 2 * border, tvguideConfig.FontStatusHeaderLarge).c_str(); - pixmapText->DrawText(cPoint(x,y), *header, theme.Color(clrFont), clrTransparent, tvguideConfig.FontStatusHeaderLarge); + pixmapText->DrawText(cPoint(x,y), *header, theme.Color(clrFont), colorTextBack, tvguideConfig.FontStatusHeaderLarge); y += tvguideConfig.FontStatusHeaderLarge->Height() + border; int heightText = pixmapText->ViewPort().Height() - y; cTextWrapper description; @@ -71,17 +72,17 @@ void cStatusHeader::DrawInfoText(cGrid *grid) { int maxLines = heightText / lineHeight; int lines = min(textLines, maxLines); for (int i = 0; i < lines-1; i++) { - pixmapText->DrawText(cPoint(x,y), description.GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontStatusHeader); + pixmapText->DrawText(cPoint(x,y), description.GetLine(i), theme.Color(clrFont), colorTextBack, tvguideConfig.FontStatusHeader); y += lineHeight; } cString lastLine = description.GetLine(lines-1); if (textLines > maxLines) { lastLine = cString::sprintf("%s...", *lastLine); } - pixmapText->DrawText(cPoint(x,y), *lastLine, theme.Color(clrFont), clrTransparent, tvguideConfig.FontStatusHeader); + pixmapText->DrawText(cPoint(x,y), *lastLine, theme.Color(clrFont), colorTextBack, tvguideConfig.FontStatusHeader); } else { int heightText = pixmapText->ViewPort().Height() - y; y += (heightText - tvguideConfig.FontStatusHeaderLarge->Height() - 2*border)/2; - pixmapText->DrawText(cPoint(x,y), *grid->getText(), theme.Color(clrFont), clrTransparent, tvguideConfig.FontStatusHeaderLarge); + pixmapText->DrawText(cPoint(x,y), *grid->getText(), theme.Color(clrFont), colorTextBack, tvguideConfig.FontStatusHeaderLarge); } }