summaryrefslogtreecommitdiff
path: root/headergrid.c
diff options
context:
space:
mode:
Diffstat (limited to 'headergrid.c')
-rw-r--r--headergrid.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/headergrid.c b/headergrid.c
index 69d0011..11f4b94 100644
--- a/headergrid.c
+++ b/headergrid.c
@@ -26,11 +26,11 @@ void cHeaderGrid::createBackground(int num) {
}
pixmap = osdManager.requestPixmap(2, cRect(x, y, width, height));
pixmapLogo = osdManager.requestPixmap(3, cRect(x, y, width, height));
- if ((!pixmap) || (!pixmapLogo)){
- return;
- }
+ if ((!pixmap) || (!pixmapLogo)){
+ return;
+ }
pixmapLogo->Fill(clrTransparent);
- drawBackground();
+ drawBackground();
}
void cHeaderGrid::drawChannel(const cChannel *channel) {
@@ -39,23 +39,23 @@ void cHeaderGrid::drawChannel(const cChannel *channel) {
} else if (tvguideConfig.displayMode == eHorizontal) {
drawChannelHorizontal(channel);
}
- drawBorder();
+ drawBorder();
}
void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
- int logoWidth = Height() * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
+ int logoWidth = Height() * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
int logoX = tvguideConfig.displayChannelName?2:(Width()-logoWidth)/2;
int textX = 5;
int textY = (Height() - tvguideConfig.FontChannelHeaderHorizontal->Height())/2;
bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) {
- cImageLoader imgLoader;
+ cImageLoader imgLoader;
if (imgLoader.LoadLogo(channel->Name(), logoWidth, Height())) {
cImage logo = imgLoader.GetImage();
pixmapLogo->DrawImage(cPoint(logoX, 0), logo);
logoFound = true;
}
- }
+ }
bool drawText = false;
int textWidthMax = Width() - 10;
if (!logoFound) {
@@ -76,36 +76,36 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
int logoWidth = Width()/2 - 15;
int logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
cTextWrapper tw;
- cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
- tw.Set(*headerText, tvguideConfig.FontChannelHeader, tvguideConfig.colWidth - 8);
- int lines = tw.Lines();
- int lineHeight = tvguideConfig.FontChannelHeader->Height();
- int yStart = (tvguideConfig.channelHeaderHeight - lines*lineHeight)/2 + 8;
- bool logoFound = false;
+ cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
+ tw.Set(*headerText, tvguideConfig.FontChannelHeader, tvguideConfig.colWidth - 8);
+ int lines = tw.Lines();
+ int lineHeight = tvguideConfig.FontChannelHeader->Height();
+ int yStart = (tvguideConfig.channelHeaderHeight - lines*lineHeight)/2 + 8;
+ bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) {
- cImageLoader imgLoader;
- if (imgLoader.LoadLogo(channel->Name(), logoWidth, logoHeight)) {
- cImage logo = imgLoader.GetImage();
+ cImageLoader imgLoader;
+ if (imgLoader.LoadLogo(channel->Name(), logoWidth, logoHeight)) {
+ cImage logo = imgLoader.GetImage();
pixmapLogo->DrawImage(cPoint((Width() - logoWidth)/2, 4), logo);
logoFound = true;
- }
- }
+ }
+ }
bool drawText = false;
if (!logoFound) {
drawText = true;
} else if (tvguideConfig.displayChannelName) {
drawText = true;
- yStart = logoHeight;
+ yStart = logoHeight;
}
if (!drawText)
return;
- for (int i=0; i<lines; i++) {
- int textWidth = tvguideConfig.FontChannelHeader->Width(tw.GetLine(i));
- int xText = (tvguideConfig.colWidth - textWidth) / 2;
- if (xText < 0)
- xText = 0;
- pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontChannelHeader);
- }
+ for (int i=0; i<lines; i++) {
+ int textWidth = tvguideConfig.FontChannelHeader->Width(tw.GetLine(i));
+ int xText = (tvguideConfig.colWidth - textWidth) / 2;
+ if (xText < 0)
+ xText = 0;
+ pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), clrTransparent, tvguideConfig.FontChannelHeader);
+ }
}
void cHeaderGrid::setPosition(int num) {
@@ -122,5 +122,5 @@ void cHeaderGrid::setPosition(int num) {
height = tvguideConfig.rowHeight;
}
pixmap->SetViewPort(cRect(x, y, width, height));
- pixmapLogo->SetViewPort(cRect(x, y, width, height));
+ pixmapLogo->SetViewPort(cRect(x, y, width, height));
}