diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2020-01-09 13:20:02 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2020-01-09 14:29:47 +0100 |
commit | 3fee6ab13f8372c1501d56916324cc95bcf06385 (patch) | |
tree | 2bf80f7894f5e320795779b79306bb568e5f362d | |
parent | ffd3e2c79f22e04ddf5f6710e5f3606c6c58dd34 (diff) | |
download | vdr-plugin-tvguide-3fee6ab13f8372c1501d56916324cc95bcf06385.tar.gz vdr-plugin-tvguide-3fee6ab13f8372c1501d56916324cc95bcf06385.tar.bz2 |
Optimize display "REC" sign in epgview
-rw-r--r-- | epggrid.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -169,13 +169,17 @@ void cEpgGrid::drawText() { void cEpgGrid::drawIcon(cString iconText, tColor color) { - const cFont *font = (config.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); + const cFont *font = (config.displayMode == eVertical) ? fontManager.FontGrid : fontManager.FontGridHorizontalSmall; + int textWidth = font->Width(*iconText) + 2 * borderWidth; + int textHeight = font->Height() + 10; + if ((config.displayMode == eHorizontal) && ((Width() - 2 * textWidth) < 0)) + pixmap->DrawEllipse( cRect(Width() - textHeight / 2 - borderWidth, Height() - textHeight - borderWidth, textHeight / 2, textHeight / 2), color); + else if ((config.displayMode == eVertical) && ((Height() - 2 * textHeight) < 0)) + pixmap->DrawEllipse( cRect(Width() - textHeight / 2 - borderWidth, borderWidth, textHeight / 2, textHeight / 2), color); + else { + pixmap->DrawEllipse( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color); + pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth / 2), *iconText, theme.Color(clrFont), clrTransparent, font); + } } cString cEpgGrid::getTimeString(void) { |