Clock in timeline if displaymode horizontal

This commit is contained in:
kamel5 2019-01-27 11:55:31 +01:00
parent e62ea368e8
commit 0f092903e8
3 changed files with 31 additions and 18 deletions

0
po/de_DE.po Executable file → Normal file
View File

View File

@ -57,7 +57,11 @@ void cStatusHeader::ScaleVideo(void) {
void cStatusHeader::DrawInfoText(cGrid *grid) { void cStatusHeader::DrawInfoText(cGrid *grid) {
int border = 10; int border = 10;
int textWidth = width - 2 * border - geoManager.clockWidth - 2; int textWidth = 0;
if (tvguideConfig.displayMode == eVertical)
textWidth = width - 2 * border - geoManager.clockWidth - 2;
else
textWidth = width - 2 * border;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
pixmapText->Fill(clrTransparent); pixmapText->Fill(clrTransparent);
int x = border; int x = border;

View File

@ -21,9 +21,9 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
geoManager.osdWidth, geoManager.osdWidth,
geoManager.timeLineGridHeight)); geoManager.timeLineGridHeight));
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (tvguideConfig.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0, dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
geoManager.statusHeaderHeight, geoManager.statusHeaderHeight,
geoManager.dateVieverWidth, geoManager.dateVieverWidth - geoManager.clockWidth,
geoManager.dateVieverHeight))); geoManager.dateVieverHeight)));
timeline = osdManager.requestPixmap(2, cRect(geoManager.channelHeaderWidth + geoManager.channelGroupsWidth, timeline = osdManager.requestPixmap(2, cRect(geoManager.channelHeaderWidth + geoManager.channelGroupsWidth,
geoManager.statusHeaderHeight, geoManager.statusHeaderHeight,
@ -39,13 +39,21 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
geoManager.timeLineHeight + tvguideConfig.channelRows * geoManager.rowHeight)); geoManager.timeLineHeight + tvguideConfig.channelRows * geoManager.rowHeight));
} }
timeBase->Fill(clrTransparent); timeBase->Fill(clrTransparent);
int clockY = 10; int clockY;
int clockX; int clockX;
if (tvguideConfig.scaleVideo) { if (tvguideConfig.displayMode == eVertical) {
clockX = geoManager.osdWidth - geoManager.tvFrameWidth - geoManager.clockWidth - 4; clockY = 10;
} else { if (tvguideConfig.scaleVideo) {
clockX = geoManager.osdWidth - geoManager.clockWidth - 10; clockX = geoManager.osdWidth - geoManager.tvFrameWidth - geoManager.clockWidth - 4;
} }
else {
clockX = geoManager.osdWidth - geoManager.clockWidth - 10;
}
}
else {
clockY = geoManager.statusHeaderHeight;
clockX = 0;
}
clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(clockX, clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(clockX,
clockY, clockY,
geoManager.clockWidth, geoManager.clockWidth,
@ -56,7 +64,7 @@ cTimeLine::~cTimeLine(void) {
delete dateViewer; delete dateViewer;
osdManager.releasePixmap(timeline); osdManager.releasePixmap(timeline);
if (clock) if (clock)
delete clock; delete clock;
} }
void cTimeLine::drawDateViewer() { void cTimeLine::drawDateViewer() {
@ -74,7 +82,7 @@ void cTimeLine::drawDateViewer() {
else else
dateViewer->Fill(clrTransparent); dateViewer->Fill(clrTransparent);
} }
tColor colorFont = theme.Color(clrFont); tColor colorFont = theme.Color(clrButtonYellow);
tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent; tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent;
if (tvguideConfig.displayMode == eVertical) { if (tvguideConfig.displayMode == eVertical) {
@ -85,7 +93,7 @@ void cTimeLine::drawDateViewer() {
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-dateWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2 + textHeight + 5), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate); dateViewer->DrawText(cPoint((geoManager.timeLineWidth-dateWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2 + textHeight + 5), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (tvguideConfig.displayMode == eHorizontal) {
cString strDate = cString::sprintf("%s %s", *weekDay, *date); cString strDate = cString::sprintf("%s %s", *weekDay, *date);
int x = (dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate))/2; int x = ((dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate)) / 2);
int y = (dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height())/2; int y = (dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height())/2;
dateViewer->DrawText(cPoint(x, y), *strDate, colorFont, colorFontBack, fontManager.FontTimeLineDateHorizontal); dateViewer->DrawText(cPoint(x, y), *strDate, colorFont, colorFontBack, fontManager.FontTimeLineDateHorizontal);
} }
@ -259,18 +267,19 @@ void cTimeLine::setTimeline() {
} }
void cTimeLine::drawClock() { void cTimeLine::drawClock() {
clock->Fill(clrTransparent); if (tvguideConfig.displayMode == eVertical)
clock->Fill(clrTransparent);
cString currentTime = myTime->GetCurrentTime(); cString currentTime = myTime->GetCurrentTime();
const cFont *font = (tvguideConfig.displayMode == eVertical)?fontManager.FontTimeLineTime:fontManager.FontTimeLineTimeHorizontal; const cFont *font = (tvguideConfig.displayMode == eVertical)?fontManager.FontTimeLineTime:fontManager.FontTimeLineTimeHorizontal;
int textHeight = font->Height(); int textHeight = font->Height();
int clockTextWidth = font->Width(*currentTime); int clockTextWidth = font->Width(*currentTime);
tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent; tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent;
if (tvguideConfig.style == eStyleGraphical) { if (tvguideConfig.style == eStyleGraphical) {
clock->drawBackgroundGraphical(bgClock); clock->drawBackgroundGraphical(bgClock);
} else { } else {
clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
clock->drawBackground(); clock->drawBackground();
clock->drawBorder(); clock->drawBorder();
} }
clock->DrawText(cPoint((geoManager.clockWidth-clockTextWidth)/2, (geoManager.clockHeight-textHeight)/2), *currentTime, theme.Color(clrFont), colorFontBack, font); clock->DrawText(cPoint((geoManager.clockWidth-clockTextWidth)/2, (geoManager.clockHeight-textHeight)/2), *currentTime, theme.Color(clrFont), colorFontBack, font);
} }