summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-11-08 16:48:59 +0100
committerlouis <louis.braun@gmx.de>2013-11-08 16:48:59 +0100
commite6c35450c4715dfe93b2275af86e7cfb11a24c7a (patch)
tree90c3f6691963b9b1aadf3d2d9cfd2b37fc6c211e
parent98a3f2bf07adef23169aad381cdf46dfe34d671b (diff)
downloadskin-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--HISTORY2
-rw-r--r--conf/theme-light.conf1
-rw-r--r--timers.c27
-rw-r--r--timers.h2
4 files changed, 24 insertions, 8 deletions
diff --git a/HISTORY b/HISTORY
index a91cdb5..7146764 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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
diff --git a/timers.c b/timers.c
index 1e13681..7c3c197 100644
--- a/timers.c
+++ b/timers.c
@@ -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
diff --git a/timers.h b/timers.h
index e47d5c5..6142dfd 100644
--- a/timers.h
+++ b/timers.h
@@ -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);