diff options
author | louis <louis.braun@gmx.de> | 2013-11-08 16:48:59 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-11-08 16:48:59 +0100 |
commit | e6c35450c4715dfe93b2275af86e7cfb11a24c7a (patch) | |
tree | 90c3f6691963b9b1aadf3d2d9cfd2b37fc6c211e /timers.c | |
parent | 98a3f2bf07adef23169aad381cdf46dfe34d671b (diff) | |
download | skin-nopacity-e6c35450c4715dfe93b2275af86e7cfb11a24c7a.tar.gz skin-nopacity-e6c35450c4715dfe93b2275af86e7cfb11a24c7a.tar.bz2 |
fixed timer display in main menu so that setting 'small without logo' uses correct height
Diffstat (limited to 'timers.c')
-rw-r--r-- | timers.c | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -111,7 +111,17 @@ void cNopacityTimer::CalculateHeight(int space) { height = numLines * lineHeight + 2*space; } else { int lineHeight = font->Height(); - height = geoManager->menuTimersLogoHeight + (numLines +1)* lineHeight + 2*space; + int channelLogoHeight = geoManager->menuTimersLogoHeight; + if (config.GetValue("showTimers") == 2) { + const cChannel *Channel = timer->Channel(); + if (Channel) { + cTextWrapper channel; + channel.Set(Channel->Name(), fontLarge, width - 10); + int lines = channel.Lines(); + channelLogoHeight = fontLarge->Height() * lines; + } + } + height = channelLogoHeight + (numLines +1)* lineHeight + 2*space; } } @@ -145,7 +155,7 @@ void cNopacityTimer::Render(void) { pixmapText->DrawText(cPoint(x, y), showName.GetLine(line), Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontLarge); } } else { - DrawLogo(); + int logoHeight = DrawLogo(); if (timer->Recording()) { pixmap->Fill(Theme.Color(clrDiskAlert)); if (config.GetValue("displayType") == dtBlending) { @@ -164,17 +174,18 @@ void cNopacityTimer::Render(void) { } } - pixmapText->DrawText(cPoint(5, geoManager->menuTimersLogoHeight), *Date, Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontLarge); + pixmapText->DrawText(cPoint(5, logoHeight), *Date, Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontLarge); int lineHeight = font->Height(); - int yStart = geoManager->menuTimersLogoHeight + lineHeight + 3; + int yStart = logoHeight + lineHeight + 3; int numLines = showName.Lines(); for (int line=0; line<numLines; line++) pixmapText->DrawText(cPoint(5, yStart+line*(lineHeight-2)), showName.GetLine(line), Theme.Color(clrMenuFontTimers), clrTransparent, font); } } -void cNopacityTimer::DrawLogo(void) { +int cNopacityTimer::DrawLogo(void) { + int totalHeight = 0; pixmapLogo->Fill(clrTransparent); int showTimerLogo = (config.GetValue("showTimers") < 2) ? 1 : 0; int logoWidth = geoManager->menuTimersLogoWidth; @@ -198,6 +209,10 @@ void cNopacityTimer::DrawLogo(void) { for (int line = 0; line < lines; line++) { pixmapLogo->DrawText(cPoint((width - fontLarge->Width(channel.GetLine(line)))/2, y+lineHeight*line), channel.GetLine(line), Theme.Color(clrMenuFontMenuItemHigh), clrTransparent, fontLarge); } + totalHeight = lineHeight * lines; + } else { + totalHeight = logoHeight; } } -} + return totalHeight; +}
\ No newline at end of file |