mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Fixed updating current time
This commit is contained in:
parent
3386c05e91
commit
9173d14b10
10
timeline.c
10
timeline.c
@ -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,10 +264,11 @@ void cTimeLine::setTimeline() {
|
||||
drawCurrentTimeBase();
|
||||
}
|
||||
|
||||
void cTimeLine::drawClock() {
|
||||
bool cTimeLine::drawClock() {
|
||||
cString currentTime = timeManager->GetCurrentTime();
|
||||
if (strcmp(currentTime, lastClock)) {
|
||||
if (config.displayMode == eVertical)
|
||||
clock->Fill(clrTransparent);
|
||||
cString currentTime = timeManager->GetCurrentTime();
|
||||
const cFont *font = (config.displayMode == eVertical) ? fontManager.FontTimeLineTime : fontManager.FontTimeLineTimeHorizontal;
|
||||
int textHeight = font->Height();
|
||||
int clockTextWidth = font->Width(*currentTime);
|
||||
@ -279,4 +281,8 @@ void cTimeLine::drawClock() {
|
||||
clock->drawBorder();
|
||||
}
|
||||
clock->DrawText(cPoint((geoManager.clockWidth - clockTextWidth) / 2, (geoManager.clockHeight - textHeight) / 2), *currentTime, theme.Color(clrFont), colorFontBack, font);
|
||||
lastClock = currentTime;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ private:
|
||||
cPixmap *timeline;
|
||||
cStyledPixmap *clock;
|
||||
cPixmap *timeBase;
|
||||
cString lastClock;
|
||||
void decorateTile(int posX, int posY, int tileWidth, int tileHeight);
|
||||
void drawRoundedCorners(int posX, int posY, int width, int height, int radius);
|
||||
cImage *createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend);
|
||||
@ -23,7 +24,7 @@ public:
|
||||
void setTimeline();
|
||||
void drawDateViewer();
|
||||
void drawTimeline();
|
||||
void drawClock();
|
||||
bool drawClock();
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_TIMELINE_H
|
||||
|
@ -373,7 +373,6 @@ void cTvGuideOsd::timeForward() {
|
||||
void cTvGuideOsd::ScrollForward() {
|
||||
timeManager->AddStep(config.stepMinutes);
|
||||
timeLine->drawDateViewer();
|
||||
timeLine->drawClock();
|
||||
timeLine->setTimeline();
|
||||
for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
|
||||
column->AddNewGridsAtEnd();
|
||||
@ -408,7 +407,6 @@ void cTvGuideOsd::ScrollBack() {
|
||||
if (tooFarInPast)
|
||||
return;
|
||||
timeLine->drawDateViewer();
|
||||
timeLine->drawClock();
|
||||
timeLine->setTimeline();
|
||||
for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
|
||||
column->AddNewGridsAtStart();
|
||||
@ -776,6 +774,9 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
|
||||
case kNone: if (channelJumper) CheckTimeout(); break;
|
||||
default: break;
|
||||
}
|
||||
if (timeLine->drawClock()) {
|
||||
osdManager.flush();
|
||||
}
|
||||
}
|
||||
if (!alreadyUnlocked) {
|
||||
cPixmap::Unlock();
|
||||
|
Loading…
Reference in New Issue
Block a user