diff options
-rw-r--r-- | geometrymanager.c | 16 | ||||
-rw-r--r-- | geometrymanager.h | 16 | ||||
-rw-r--r-- | headergrid.c | 9 | ||||
-rw-r--r-- | statusheader.c | 7 | ||||
-rw-r--r-- | timeline.c | 25 |
5 files changed, 34 insertions, 39 deletions
diff --git a/geometrymanager.c b/geometrymanager.c index 94d47b7..72befa4 100644 --- a/geometrymanager.c +++ b/geometrymanager.c @@ -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;
@@ -71,4 +73,4 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) { channelJumpHeight = osdHeight * 20 / 100;
return true;
-}
\ No newline at end of file +}
diff --git a/geometrymanager.h b/geometrymanager.h index ecd31b9..c0433d4 100644 --- a/geometrymanager.h +++ b/geometrymanager.h @@ -4,17 +4,17 @@ class cGeometryManager {
private:
public:
- cGeometryManager(void);
- ~cGeometryManager();
- bool SetGeometry(int osdWidth, int osdHeight, bool force = false);
+ cGeometryManager(void);
+ ~cGeometryManager();
+ bool SetGeometry(int osdWidth, int osdHeight, bool force = false);
//Common
- int osdWidth;
- int osdHeight;
- int statusHeaderHeight;
+ int osdWidth;
+ int osdHeight;
+ int statusHeaderHeight;
int tvFrameWidth;
int headerContentWidth;
//ChannelGroups
- int channelGroupsWidth;
+ int channelGroupsWidth;
int channelGroupsHeight;
//ContentHeader
int channelHeaderWidth;
@@ -51,4 +51,4 @@ public: int channelJumpHeight;
};
-#endif //__TVGUIDE_GEOMETRYMANAGER_H
\ No newline at end of file +#endif //__TVGUIDE_GEOMETRYMANAGER_H
diff --git a/headergrid.c b/headergrid.c index 0b61097..94f0c9c 100644 --- a/headergrid.c +++ b/headergrid.c @@ -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);
}
}
diff --git a/statusheader.c b/statusheader.c index 9b9e9a0..f5db056 100644 --- a/statusheader.c +++ b/statusheader.c @@ -58,10 +58,7 @@ 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;
+ textWidth = width - 2 * border;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
pixmapText->Fill(clrTransparent);
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->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);
-}
\ No newline at end of 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);
}
}
|