Optical changes in displaymode vertical

This commit is contained in:
kamel5 2019-04-08 14:16:21 +02:00
parent 56250e3af8
commit 929d8db9ba
5 changed files with 34 additions and 39 deletions

View File

@ -29,8 +29,6 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100;
timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100;
timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100;
clockWidth = tvFrameWidth / 3;
clockHeight = timeLineHeight;
footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100;
footerY = osdHeight - footerHeight;
@ -43,9 +41,11 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
logoWidth = channelLogoWidth/2 - 15;
logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
timeLineGridWidth = timeLineWidth;
timeLineGridHeight = minutePixel*30;
timeLineGridHeight = minutePixel * 30;
dateVieverWidth = timeLineWidth;
dateVieverHeight = channelHeaderHeight + channelGroupsHeight;
dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3;
clockWidth = dateVieverWidth;
clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight;
} else if (tvguideConfig.displayMode == eHorizontal) {
colWidth = 0;
rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows;
@ -54,10 +54,12 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
channelLogoHeight = rowHeight;
logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
logoHeight = channelLogoHeight;
timeLineGridWidth = geoManager.minutePixel*30;
timeLineGridWidth = geoManager.minutePixel * 30;
timeLineGridHeight = geoManager.timeLineHeight;
dateVieverWidth = channelHeaderWidth + channelGroupsWidth;
dateVieverWidth = (channelHeaderWidth + channelGroupsWidth) * 3 / 5;
dateVieverHeight = timeLineHeight;
clockWidth = (channelHeaderWidth + channelGroupsWidth) - dateVieverWidth;
clockHeight = timeLineHeight;
}
buttonBorder = footerHeight / 6;
buttonWidth = osdWidth / 4 - 2 * buttonBorder;

View File

@ -88,13 +88,12 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
tw.Set(*headerText, fontManager.FontChannelHeader, geoManager.colWidth - 8);
int lines = tw.Lines();
int lineHeight = fontManager.FontChannelHeader->Height();
int yStart = (geoManager.channelHeaderHeight - lines*lineHeight)/2 + 8;
int yStart = (geoManager.channelHeaderHeight - lines * lineHeight) / 2 + 8;
bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel);
if (logo) {
const int logoheight = logo->Height();
pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, (geoManager.channelHeaderHeight - lineHeight - logoheight) / 2), *logo);
pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo);
logoFound = true;
}
}
@ -108,12 +107,12 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
if (!drawText)
return;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
for (int i=0; i<lines; i++) {
for (int i = 0; i < lines; i++) {
int textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i));
int xText = (geoManager.colWidth - textWidth) / 2;
if (xText < 0)
xText = 0;
pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeader);
pixmap->DrawText(cPoint(xText, yStart + i * lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeader);
}
}

View File

@ -58,9 +58,6 @@ void cStatusHeader::ScaleVideo(void) {
void cStatusHeader::DrawInfoText(cGrid *grid) {
int border = 10;
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;
pixmapText->Fill(clrTransparent);

View File

@ -5,7 +5,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
this->myTime = myTime;
if (tvguideConfig.displayMode == eVertical) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
geoManager.statusHeaderHeight,
geoManager.statusHeaderHeight + geoManager.clockHeight,
geoManager.dateVieverWidth,
geoManager.dateVieverHeight)));
timeline = osdManager.requestPixmap(2, cRect(0,
@ -23,7 +23,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
} else if (tvguideConfig.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
geoManager.statusHeaderHeight,
geoManager.dateVieverWidth - geoManager.clockWidth,
geoManager.dateVieverWidth,
geoManager.dateVieverHeight)));
timeline = osdManager.requestPixmap(2, cRect(geoManager.channelHeaderWidth + geoManager.channelGroupsWidth,
geoManager.statusHeaderHeight,
@ -42,13 +42,8 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
int clockY;
int clockX;
if (tvguideConfig.displayMode == eVertical) {
clockY = 10;
if (tvguideConfig.scaleVideo) {
clockX = geoManager.osdWidth - geoManager.tvFrameWidth - geoManager.clockWidth - 4;
}
else {
clockX = geoManager.osdWidth - geoManager.clockWidth - 10;
}
clockY = geoManager.statusHeaderHeight;
clockX = 0;
}
else {
clockY = geoManager.statusHeaderHeight;
@ -83,18 +78,20 @@ void cTimeLine::drawDateViewer() {
dateViewer->Fill(clrTransparent);
}
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) {
int textHeight = fontManager.FontTimeLineWeekday->Height();
int textHeightWeekday = fontManager.FontTimeLineWeekday->Height();
int textHeightDate = fontManager.FontTimeLineDate->Height();
int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay);
int dateWidth = fontManager.FontTimeLineDate->Width(*date);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-weekdayWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-dateWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2 + textHeight + 5), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
int y = ((geoManager.dateVieverHeight - textHeightWeekday - textHeightDate) / 2);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth - weekdayWidth) / 2, y), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth - dateWidth) / 2, y + textHeightWeekday), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
} else if (tvguideConfig.displayMode == eHorizontal) {
cString strDate = cString::sprintf("%s %s", *weekDay, *date);
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);
}
}