Fixed a bug in color display

This commit is contained in:
louis 2013-05-26 16:54:22 +02:00
parent 4067a403db
commit d775c945bf
3 changed files with 18 additions and 10 deletions

View File

@ -38,13 +38,15 @@ bool cOsdManager::setOsd() {
} }
void cOsdManager::setBackground() { void cOsdManager::setBackground() {
esyslog("tvguide: %d %d", Width(), Height());
if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) { if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) {
int widthStatus = cOsd::OsdWidth() - tvguideConfig.statusHeaderHeight * 16 / 9; int widthStatus = cOsd::OsdWidth() - tvguideConfig.statusHeaderHeight * 16 / 9;
osd->DrawRectangle(0, 0, widthStatus, tvguideConfig.statusHeaderHeight, theme.Color(clrBackgroundOSD)); osd->DrawRectangle(0, 0, widthStatus, tvguideConfig.statusHeaderHeight, theme.Color(clrBackgroundOSD));
osd->DrawRectangle(0, tvguideConfig.statusHeaderHeight, cOsd::OsdWidth(), cOsd::OsdHeight() - tvguideConfig.statusHeaderHeight, theme.Color(clrBackgroundOSD)); osd->DrawRectangle(0, tvguideConfig.statusHeaderHeight, Width(), Height(), theme.Color(clrBackgroundOSD));
} }
else else
osd->DrawRectangle(0, 0, cOsd::OsdWidth(), cOsd::OsdHeight(), theme.Color(clrBackgroundOSD)); osd->DrawRectangle(0, 0, Width(), Height(), theme.Color(clrBackgroundOSD));
} }
cPixmap *cOsdManager::requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) { cPixmap *cOsdManager::requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) {

View File

@ -12,7 +12,9 @@ clrFontHeader = FFFFFFFF
clrFontButtons = FFFFFFFF clrFontButtons = FFFFFFFF
clrHeader = EE888888 clrHeader = EE888888
clrHeaderBlending = 90000000 clrHeaderBlending = 90000000
clrBorder = AABB0000 clrBorder = AABB0000
clrStatusHeader = 00000000
clrStatusHeaderBlending = 00000000
clrTimeline1 = BBFFFFFF clrTimeline1 = BBFFFFFF
clrTimeline1Blending = 90828282 clrTimeline1Blending = 90828282
clrTimeline2 = BB000000 clrTimeline2 = BB000000

View File

@ -48,25 +48,26 @@ void cTimeLine::drawDateViewer() {
dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
dateViewer->drawBackground(); dateViewer->drawBackground();
dateViewer->drawBorder(); dateViewer->drawBorder();
tColor colorFontBack = (tvguideConfig.useBlending==0)?theme.Color(clrHeader):clrTransparent;
if (tvguideConfig.displayMode == eVertical) { if (tvguideConfig.displayMode == eVertical) {
int textHeight = tvguideConfig.FontTimeLineWeekday->Height(); int textHeight = tvguideConfig.FontTimeLineWeekday->Height();
int weekdayWidth = tvguideConfig.FontTimeLineWeekday->Width(*weekDay); int weekdayWidth = tvguideConfig.FontTimeLineWeekday->Width(*weekDay);
int dateWidth = tvguideConfig.FontTimeLineDate->Width(*date); int dateWidth = tvguideConfig.FontTimeLineDate->Width(*date);
dateViewer->DrawText(cPoint((tvguideConfig.timeLineWidth-weekdayWidth)/2, (tvguideConfig.channelHeaderHeight-2*textHeight)/2), *weekDay, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineWeekday); dateViewer->DrawText(cPoint((tvguideConfig.timeLineWidth-weekdayWidth)/2, (tvguideConfig.channelHeaderHeight-2*textHeight)/2), *weekDay, theme.Color(clrFontHeader), colorFontBack, tvguideConfig.FontTimeLineWeekday);
dateViewer->DrawText(cPoint((tvguideConfig.timeLineWidth-dateWidth)/2, (tvguideConfig.channelHeaderHeight-2*textHeight)/2 + textHeight + 5), *date, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineDate); dateViewer->DrawText(cPoint((tvguideConfig.timeLineWidth-dateWidth)/2, (tvguideConfig.channelHeaderHeight-2*textHeight)/2 + textHeight + 5), *date, theme.Color(clrFontHeader), colorFontBack, tvguideConfig.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() - tvguideConfig.FontTimeLineDateHorizontal->Width(*strDate))/2; int x = (dateViewer->Width() - tvguideConfig.FontTimeLineDateHorizontal->Width(*strDate))/2;
int y = (dateViewer->Height() - tvguideConfig.FontTimeLineDateHorizontal->Height())/2; int y = (dateViewer->Height() - tvguideConfig.FontTimeLineDateHorizontal->Height())/2;
dateViewer->DrawText(cPoint(x, y), *strDate, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineDateHorizontal); dateViewer->DrawText(cPoint(x, y), *strDate, theme.Color(clrFontHeader), colorFontBack, tvguideConfig.FontTimeLineDateHorizontal);
} }
} }
void cTimeLine::drawTimeline() { void cTimeLine::drawTimeline() {
timeline->SetTile(true); timeline->SetTile(true);
timeline->Fill(theme.Color(clrBackground)); timeline->Fill(theme.Color(clrBackground));
tColor colorFont; tColor colorFont, colorBackground;
int imgWidth, imgHeight; int imgWidth, imgHeight;
if (tvguideConfig.displayMode == eVertical) { if (tvguideConfig.displayMode == eVertical) {
@ -87,6 +88,7 @@ void cTimeLine::drawTimeline() {
if (i%2==0) { if (i%2==0) {
img = img1; img = img1;
colorFont = theme.Color(clrTimeline2); colorFont = theme.Color(clrTimeline2);
colorBackground = (tvguideConfig.useBlending==0)?theme.Color(clrTimeline1):clrTransparent;
if (tvguideConfig.timeFormat == e12Hours) { if (tvguideConfig.timeFormat == e12Hours) {
if (i == 0) if (i == 0)
sprintf(timetext, "12:00 PM"); sprintf(timetext, "12:00 PM");
@ -100,6 +102,7 @@ void cTimeLine::drawTimeline() {
} else { } else {
img = img2; img = img2;
colorFont = theme.Color(clrTimeline1); colorFont = theme.Color(clrTimeline1);
colorBackground = (tvguideConfig.useBlending==0)?theme.Color(clrTimeline2):clrTransparent;
if (tvguideConfig.timeFormat == e12Hours) { if (tvguideConfig.timeFormat == e12Hours) {
if (i == 1) if (i == 1)
sprintf(timetext, "12:30 PM"); sprintf(timetext, "12:30 PM");
@ -115,11 +118,11 @@ void cTimeLine::drawTimeline() {
posY = i*tvguideConfig.minutePixel*30; posY = i*tvguideConfig.minutePixel*30;
timeline->DrawImage(cPoint(2, posY), *img); timeline->DrawImage(cPoint(2, posY), *img);
textWidth = tvguideConfig.FontTimeLineTime->Width(timetext); textWidth = tvguideConfig.FontTimeLineTime->Width(timetext);
timeline->DrawText(cPoint((tvguideConfig.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, clrTransparent, tvguideConfig.FontTimeLineTime); timeline->DrawText(cPoint((tvguideConfig.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, colorBackground, tvguideConfig.FontTimeLineTime);
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (tvguideConfig.displayMode == eHorizontal) {
posX = i*tvguideConfig.minutePixel*30; posX = i*tvguideConfig.minutePixel*30;
timeline->DrawImage(cPoint(posX, 2), *img); timeline->DrawImage(cPoint(posX, 2), *img);
timeline->DrawText(cPoint(posX + 2, (dateViewer->Height() - tvguideConfig.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, clrTransparent, tvguideConfig.FontTimeLineTimeHorizontal); timeline->DrawText(cPoint(posX + 2, (dateViewer->Height() - tvguideConfig.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, tvguideConfig.FontTimeLineTimeHorizontal);
} }
} }
setTimeline(); setTimeline();
@ -173,8 +176,9 @@ void cTimeLine::drawClock() {
cString currentTime = myTime->GetCurrentTime(); cString currentTime = myTime->GetCurrentTime();
int textHeight = tvguideConfig.FontTimeLineTime->Height(); int textHeight = tvguideConfig.FontTimeLineTime->Height();
int clockWidth = tvguideConfig.FontTimeLineTime->Width(*currentTime); int clockWidth = tvguideConfig.FontTimeLineTime->Width(*currentTime);
tColor colorFontBack = (tvguideConfig.useBlending==0)?theme.Color(clrHeader):clrTransparent;
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((tvguideConfig.timeLineWidth-clockWidth)/2, (tvguideConfig.footerHeight-textHeight)/2), *currentTime, theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontTimeLineTime); clock->DrawText(cPoint((tvguideConfig.timeLineWidth-clockWidth)/2, (tvguideConfig.footerHeight-textHeight)/2), *currentTime, theme.Color(clrFontHeader), colorFontBack, tvguideConfig.FontTimeLineTime);
} }