diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-10-13 12:16:34 +0200 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-10-13 13:46:23 +0200 |
commit | 9173d14b10ee39ab206be98fe5a01c5591f392d2 (patch) | |
tree | f420d70723531255c8349beb4aefdcf0807a8ebb /timeline.c | |
parent | 3386c05e915d23c1f6126b8c7deac172857feaaf (diff) | |
download | vdr-plugin-tvguide-9173d14b10ee39ab206be98fe5a01c5591f392d2.tar.gz vdr-plugin-tvguide-9173d14b10ee39ab206be98fe5a01c5591f392d2.tar.bz2 |
Fixed updating current time
Diffstat (limited to 'timeline.c')
-rw-r--r-- | timeline.c | 34 |
1 files changed, 20 insertions, 14 deletions
@@ -3,6 +3,7 @@ cTimeLine::cTimeLine(cTimeManager *timeManager) { this->timeManager = timeManager; + lastClock = ""; if (config.displayMode == eVertical) { dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0, geoManager.statusHeaderHeight + geoManager.clockHeight, @@ -263,20 +264,25 @@ void cTimeLine::setTimeline() { drawCurrentTimeBase(); } -void cTimeLine::drawClock() { - if (config.displayMode == eVertical) - clock->Fill(clrTransparent); +bool cTimeLine::drawClock() { cString currentTime = timeManager->GetCurrentTime(); - const cFont *font = (config.displayMode == eVertical)?fontManager.FontTimeLineTime:fontManager.FontTimeLineTimeHorizontal; - int textHeight = font->Height(); - int clockTextWidth = font->Width(*currentTime); - tColor colorFontBack = (config.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent; - if (config.style == eStyleGraphical) { - clock->drawBackgroundGraphical(bgClock); - } else { - clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); - clock->drawBackground(); - clock->drawBorder(); + if (strcmp(currentTime, lastClock)) { + if (config.displayMode == eVertical) + clock->Fill(clrTransparent); + const cFont *font = (config.displayMode == eVertical) ? fontManager.FontTimeLineTime : fontManager.FontTimeLineTimeHorizontal; + int textHeight = font->Height(); + int clockTextWidth = font->Width(*currentTime); + tColor colorFontBack = (config.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent; + if (config.style == eStyleGraphical) { + clock->drawBackgroundGraphical(bgClock); + } else { + clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); + clock->drawBackground(); + clock->drawBorder(); + } + clock->DrawText(cPoint((geoManager.clockWidth - clockTextWidth) / 2, (geoManager.clockHeight - textHeight) / 2), *currentTime, theme.Color(clrFont), colorFontBack, font); + lastClock = currentTime; + return true; } - clock->DrawText(cPoint((geoManager.clockWidth-clockTextWidth)/2, (geoManager.clockHeight-textHeight)/2), *currentTime, theme.Color(clrFont), colorFontBack, font); + return false; } |