From 9373bd78da56e27648c2d4af9d12fb7e98da9429 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Sat, 18 Dec 2021 12:21:29 +0100 Subject: Optimize display timers in main menu --- timers.c | 9 ++++----- 1 file 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; } -- cgit v1.2.3