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 | |
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
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | conf/theme-light.conf | 1 | ||||
-rw-r--r-- | timers.c | 27 | ||||
-rw-r--r-- | timers.h | 2 |
4 files changed, 24 insertions, 8 deletions
@@ -356,3 +356,5 @@ Version 0.1.4 not drawn correctly - added possibility to add background image in freestyle themes in displaymenu header (headerback.png, header_mirroredback.png) +- fixed timer display in main menu so that setting "small without logo" + uses correct height diff --git a/conf/theme-light.conf b/conf/theme-light.conf index 93835d0..c11cc9c 100644 --- a/conf/theme-light.conf +++ b/conf/theme-light.conf @@ -17,7 +17,6 @@ fontTimers = -4 fontTimersHead = -6 footerHeight = 6 headerHeight = 6 -headerIconHeight = 100 mainMenuTitleStyle = 0 menuSizeDiskUsage = 13 menuWidthChannels = 37 @@ -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 @@ -24,7 +24,7 @@ class cNopacityTimer : public cListObject { int y; cString Date; cTextWrapper showName; - void DrawLogo(void); + int DrawLogo(void); public: cNopacityTimer(cOsd *osd, cImageCache *imgCache, const cTimer *timer, const cFont *font, const cFont *fontLarge); cNopacityTimer(cOsd *osd, cImageCache *imgCache, int numConflicts, const cFont *font, const cFont *fontLarge); |