From 9c8e8a2dd6c1414196d4d059252e43cada52eeb7 Mon Sep 17 00:00:00 2001 From: Soeren Moch Date: Fri, 20 May 2022 23:13:32 +0200 Subject: Align channel logo background Use maximum logo space for background. So the logo background image is aligned to the menu background. The channel logo itself is usually smaller than the background due to scaling with preserved aspect ratio. So use separate geometry settings for logo and background. Signed-off-by: Soeren Moch --- displaychannelview.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'displaychannelview.c') diff --git a/displaychannelview.c b/displaychannelview.c index bb726fb..016dbb9 100644 --- a/displaychannelview.c +++ b/displaychannelview.c @@ -77,10 +77,10 @@ void cNopacityDisplayChannelView::CreatePixmaps(void) { geoManager->channelLogoHeight) ); pixmapLogoBackground = osd->CreatePixmap(2, - cRect(geoManager->channelX + geoManager->channelLogoX, - geoManager->channelLogoY, - geoManager->channelLogoWidth, - geoManager->channelLogoHeight) + cRect(geoManager->channelX + geoManager->channelLogoBgX, + geoManager->channelLogoBgY, + geoManager->channelLogoBgWidth, + geoManager->channelLogoBgHeight) ); pixmapChannelName = osd->CreatePixmap(2, cRect(geoManager->channelX + geoManager->channelContentX, @@ -228,7 +228,7 @@ void cNopacityDisplayChannelView::DrawChannelLogo(const cChannel *Channel) { if (config.GetValue("displayType") != dtFlat && config.GetValue("channelUseLogoBackground")) { cImage *imgLogoBack = imgCache->GetSkinElement(seChannelLogoBack); if (imgLogoBack) - pixmapLogoBackground->DrawImage(cPoint(0,0), *imgLogoBack); + pixmapLogoBackground->DrawImage(cPoint((geoManager->channelLogoBgWidth - imgLogoBack->Width()) / 2, (geoManager->channelLogoBgHeight - imgLogoBack->Height()) / 2), *imgLogoBack); } cImage *imgLogo = imgCache->GetLogo(ctLogo, Channel); if (imgLogo) { -- cgit v1.2.3