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;
@ -43,9 +41,11 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
logoWidth = channelLogoWidth/2 - 15; logoWidth = channelLogoWidth/2 - 15;
logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio; logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
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;
@ -54,10 +54,12 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
channelLogoHeight = rowHeight; channelLogoHeight = rowHeight;
logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
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;
@ -71,4 +73,4 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
channelJumpHeight = osdHeight * 20 / 100; channelJumpHeight = osdHeight * 20 / 100;
return true; return true;
} }

View File

@ -4,17 +4,17 @@
class cGeometryManager { class cGeometryManager {
private: private:
public: public:
cGeometryManager(void); cGeometryManager(void);
~cGeometryManager(); ~cGeometryManager();
bool SetGeometry(int osdWidth, int osdHeight, bool force = false); bool SetGeometry(int osdWidth, int osdHeight, bool force = false);
//Common //Common
int osdWidth; int osdWidth;
int osdHeight; int osdHeight;
int statusHeaderHeight; int statusHeaderHeight;
int tvFrameWidth; int tvFrameWidth;
int headerContentWidth; int headerContentWidth;
//ChannelGroups //ChannelGroups
int channelGroupsWidth; int channelGroupsWidth;
int channelGroupsHeight; int channelGroupsHeight;
//ContentHeader //ContentHeader
int channelHeaderWidth; int channelHeaderWidth;
@ -51,4 +51,4 @@ public:
int channelJumpHeight; int channelJumpHeight;
}; };
#endif //__TVGUIDE_GEOMETRYMANAGER_H #endif //__TVGUIDE_GEOMETRYMANAGER_H

View File

@ -88,13 +88,12 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
tw.Set(*headerText, fontManager.FontChannelHeader, geoManager.colWidth - 8); tw.Set(*headerText, fontManager.FontChannelHeader, geoManager.colWidth - 8);
int lines = tw.Lines(); int lines = tw.Lines();
int lineHeight = fontManager.FontChannelHeader->Height(); int lineHeight = fontManager.FontChannelHeader->Height();
int yStart = (geoManager.channelHeaderHeight - lines*lineHeight)/2 + 8; int yStart = (geoManager.channelHeaderHeight - lines * lineHeight) / 2 + 8;
bool logoFound = false; bool logoFound = false;
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;
} }
} }
@ -108,12 +107,12 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
if (!drawText) if (!drawText)
return; return;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; 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 textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i));
int xText = (geoManager.colWidth - textWidth) / 2; int xText = (geoManager.colWidth - textWidth) / 2;
if (xText < 0) if (xText < 0)
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,10 +58,7 @@ 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;
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;
@ -143,4 +140,4 @@ void cStatusHeader::DecorateVideoFrame(void) {
pixmapTVFrame->DrawEllipse(cRect(frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -3); pixmapTVFrame->DrawEllipse(cRect(frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -3);
pixmapTVFrame->DrawRectangle(cRect(0, height - frame, tvFrameWidth, frame), theme.Color(clrBackgroundOSD)); pixmapTVFrame->DrawRectangle(cRect(0, height - frame, tvFrameWidth, frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius - frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -4); pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius - frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -4);
} }

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;
@ -83,18 +78,20 @@ void cTimeLine::drawDateViewer() {
dateViewer->Fill(clrTransparent); dateViewer->Fill(clrTransparent);
} }
tColor colorFont = theme.Color(clrButtonYellow); 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) {
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);
} }
} }