diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2020-03-05 14:46:52 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2020-03-06 14:01:47 +0100 |
commit | eb3a4113be6e0b64e048caa8bfedcb8bcc2e577d (patch) | |
tree | 84737a6704dcd7849114060115218a061d47fa3c | |
parent | 7ec89bf12bab99b84363564075c0def9477d28fe (diff) | |
download | vdr-plugin-tvguide-eb3a4113be6e0b64e048caa8bfedcb8bcc2e577d.tar.gz vdr-plugin-tvguide-eb3a4113be6e0b64e048caa8bfedcb8bcc2e577d.tar.bz2 |
Fixed horizontal alignment in timeline
-rw-r--r-- | recmenuitem.c | 5 | ||||
-rw-r--r-- | recmenuitem.h | 4 | ||||
-rw-r--r-- | recmenus.c | 23 |
3 files changed, 12 insertions, 20 deletions
diff --git a/recmenuitem.c b/recmenuitem.c index db54c2c..f8c5ec8 100644 --- a/recmenuitem.c +++ b/recmenuitem.c @@ -2430,7 +2430,7 @@ void cRecMenuItemTimelineHeader::DrawTimeline(void) { pixmapTimeline->Fill(clrTransparent); width5Mins = (float)width * 5.0 / 24.0 / 60.0; int widthHour = 12 * width5Mins; - x0 = (width - 24*widthHour)/2; + x0 = (width - (24 * widthHour)) / 2; int barHeight = fontSmall->Height(); int y = height - barHeight; tColor col1 = theme.Color(clrTimeline1); @@ -2535,7 +2535,8 @@ void cRecMenuItemTimelineTimer::SetPixmaps(void) { } width5Mins = (float)width * 5.0 / 24.0 / 60.0; - x0 = (width - 24*12*width5Mins)/2; + int widthHour = 12 * width5Mins; + x0 = (width - (24 * widthHour)) / 2; } void cRecMenuItemTimelineTimer::Draw(void) { diff --git a/recmenuitem.h b/recmenuitem.h index 866391e..298e46f 100644 --- a/recmenuitem.h +++ b/recmenuitem.h @@ -573,7 +573,7 @@ private: cPixmap *pixmapTimeline; cPixmap *pixmapTimerInfo; cPixmap *pixmapTimerConflicts; - int width5Mins; + float width5Mins; int x0; int numTimersToday; bool timelineDrawn; @@ -603,7 +603,7 @@ private: cPixmap *pixmapTimerConflicts; cRecMenuItemTimelineHeader *header; int x0; - int width5Mins; + float width5Mins; time_t start; time_t stop; void DrawBackground(void); @@ -1413,7 +1413,7 @@ cRecMenuTimeline::cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts) { SetStartStop(); conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop); GetTimersForDay(); - SetWidthPercent(95); + SetWidthPercent(90); header = new cRecMenuItemTimelineHeader(timeStart, numTimersToday, conflictsToday); SetHeader(header); cRecMenuItem *footer = new cRecMenuItemButton(tr("Close"), rmsClose, false, true); @@ -1457,10 +1457,14 @@ void cRecMenuTimeline::GetTimersForDay(void) { void cRecMenuTimeline::SetTimers(void) { ClearMenu(); + GetTimersForDay(); + conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop); + header->UnsetCurrentTimer(); + header->SetDay(timeStart); + header->RefreshTimerDisplay(); + header->SetNumTimersToday(numTimersToday); if (numTimersToday == 0) { AddMenuItem(new cRecMenuItemTimelineTimer(NULL, 0, 0, conflictsToday, header, false)); - header->UnsetCurrentTimer(); - header->SetNumTimersToday(0); footer->setActive(); } else { for (int i = 0; i<numTimersToday; i++) { @@ -1469,7 +1473,6 @@ void cRecMenuTimeline::SetTimers(void) { item->setActive(); if (!AddMenuItemInitial(item)) break; - header->SetNumTimersToday(numTimersToday); } footer->setInactive(); } @@ -1483,12 +1486,6 @@ void cRecMenuTimeline::PrevDay(void) { return; timeStart -= 3600*24; timeStop -= 3600*24; - conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop); - SetWidthPercent(95); - header->SetDay(timeStart); - header->UnsetCurrentTimer(); - header->RefreshTimerDisplay(); - GetTimersForDay(); SetTimers(); Display(); } @@ -1496,12 +1493,6 @@ void cRecMenuTimeline::PrevDay(void) { void cRecMenuTimeline::NextDay(void) { timeStart += 3600*24; timeStop += 3600*24; - conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop); - SetWidthPercent(95); - header->SetDay(timeStart); - header->UnsetCurrentTimer(); - header->RefreshTimerDisplay(); - GetTimersForDay(); SetTimers(); Display(); } |