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; channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100;
timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100; timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100;
timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100; timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100;
clockWidth = tvFrameWidth / 3;
clockHeight = timeLineHeight;
footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100; footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100;
footerY = osdHeight - footerHeight; footerY = osdHeight - footerHeight;
@ -45,7 +43,9 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
timeLineGridWidth = timeLineWidth; timeLineGridWidth = timeLineWidth;
timeLineGridHeight = minutePixel * 30; timeLineGridHeight = minutePixel * 30;
dateVieverWidth = timeLineWidth; dateVieverWidth = timeLineWidth;
dateVieverHeight = channelHeaderHeight + channelGroupsHeight; dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3;
clockWidth = dateVieverWidth;
clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight;
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (tvguideConfig.displayMode == eHorizontal) {
colWidth = 0; colWidth = 0;
rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows; rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows;
@ -56,8 +56,10 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
logoHeight = channelLogoHeight; logoHeight = channelLogoHeight;
timeLineGridWidth = geoManager.minutePixel * 30; timeLineGridWidth = geoManager.minutePixel * 30;
timeLineGridHeight = geoManager.timeLineHeight; timeLineGridHeight = geoManager.timeLineHeight;
dateVieverWidth = channelHeaderWidth + channelGroupsWidth; dateVieverWidth = (channelHeaderWidth + channelGroupsWidth) * 3 / 5;
dateVieverHeight = timeLineHeight; dateVieverHeight = timeLineHeight;
clockWidth = (channelHeaderWidth + channelGroupsWidth) - dateVieverWidth;
clockHeight = timeLineHeight;
} }
buttonBorder = footerHeight / 6; buttonBorder = footerHeight / 6;
buttonWidth = osdWidth / 4 - 2 * buttonBorder; buttonWidth = osdWidth / 4 - 2 * buttonBorder;

View File

@ -93,8 +93,7 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
if (!tvguideConfig.hideChannelLogos) { if (!tvguideConfig.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel); cImage *logo = imgCache.GetLogo(channel);
if (logo) { if (logo) {
const int logoheight = logo->Height(); pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo);
pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, (geoManager.channelHeaderHeight - lineHeight - logoheight) / 2), *logo);
logoFound = true; logoFound = true;
} }
} }

View File

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

View File

@ -5,7 +5,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
this->myTime = myTime; this->myTime = myTime;
if (tvguideConfig.displayMode == eVertical) { if (tvguideConfig.displayMode == eVertical) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0, dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
geoManager.statusHeaderHeight, geoManager.statusHeaderHeight + geoManager.clockHeight,
geoManager.dateVieverWidth, geoManager.dateVieverWidth,
geoManager.dateVieverHeight))); geoManager.dateVieverHeight)));
timeline = osdManager.requestPixmap(2, cRect(0, timeline = osdManager.requestPixmap(2, cRect(0,
@ -23,7 +23,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
} else if (tvguideConfig.displayMode == eHorizontal) { } else if (tvguideConfig.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth, dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
geoManager.statusHeaderHeight, geoManager.statusHeaderHeight,
geoManager.dateVieverWidth - geoManager.clockWidth, geoManager.dateVieverWidth,
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,
@ -42,13 +42,8 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
int clockY; int clockY;
int clockX; int clockX;
if (tvguideConfig.displayMode == eVertical) { if (tvguideConfig.displayMode == eVertical) {
clockY = 10; clockY = geoManager.statusHeaderHeight;
if (tvguideConfig.scaleVideo) { clockX = 0;
clockX = geoManager.osdWidth - geoManager.tvFrameWidth - geoManager.clockWidth - 4;
}
else {
clockX = geoManager.osdWidth - geoManager.clockWidth - 10;
}
} }
else { else {
clockY = geoManager.statusHeaderHeight; clockY = geoManager.statusHeaderHeight;
@ -86,15 +81,17 @@ void cTimeLine::drawDateViewer() {
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) {
int textHeight = fontManager.FontTimeLineWeekday->Height(); int textHeightWeekday = fontManager.FontTimeLineWeekday->Height();
int textHeightDate = fontManager.FontTimeLineDate->Height();
int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay); int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay);
int dateWidth = fontManager.FontTimeLineDate->Width(*date); 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); int y = ((geoManager.dateVieverHeight - textHeightWeekday - textHeightDate) / 2);
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 - 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) { } 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);
} }
} }