summaryrefslogtreecommitdiff
path: root/timers.c
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2021-12-18 12:21:29 +0100
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2022-01-12 13:48:19 +0100
commit9373bd78da56e27648c2d4af9d12fb7e98da9429 (patch)
tree0e9c1bbb92841e1bcbd84f4c3d2d7842c330a06d /timers.c
parent13d96ff79051c84d9c85ab414db7f97e5c772cec (diff)
downloadskin-nopacity-9373bd78da56e27648c2d4af9d12fb7e98da9429.tar.gz
skin-nopacity-9373bd78da56e27648c2d4af9d12fb7e98da9429.tar.bz2
Optimize display timers in main menu
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/timers.c b/timers.c
index 409da48..fe5d040 100644
--- a/timers.c
+++ b/timers.c
@@ -186,7 +186,6 @@ int cNopacityTimer::DrawLogo(void) {
int totalHeight = 0;
pixmapLogo->Fill(clrTransparent);
int showTimerLogo = (config.GetValue("showTimers") < 2) ? 1 : 0;
- int logoWidth = geoManager->menuTimersLogoWidth;
int logoHeight = geoManager->menuTimersLogoHeight;
const cChannel *Channel = timer->Channel();
if (Channel) {
@@ -195,7 +194,7 @@ int cNopacityTimer::DrawLogo(void) {
cImage *logo = imgCache->GetLogo(ctLogoTimer, Channel);
if (logo) {
logoFound = true;
- pixmapLogo->DrawImage(cPoint((width - logoWidth)/2, 1), *logo);
+ pixmapLogo->DrawImage(cPoint((width - logo->Width()) / 2, (logoHeight - logo->Height()) / 2), *logo);
}
}
if (!showTimerLogo || !logoFound) {
@@ -203,11 +202,11 @@ int cNopacityTimer::DrawLogo(void) {
channel.Set(Channel->Name(), fontLarge, width - 10);
int lines = channel.Lines();
int lineHeight = fontLarge->Height();
- int y = 1;
+ int y = 5;
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);
+ pixmapLogo->DrawText(cPoint((width - fontLarge->Width(channel.GetLine(line))) / 2, y + lineHeight * line), channel.GetLine(line), Theme.Color(clrMenuFontMenuItemHigh), clrTransparent, fontLarge);
}
- totalHeight = lineHeight * lines;
+ totalHeight = std::max(logoHeight, lineHeight * lines + 10);
} else {
totalHeight = logoHeight;
}