diff options
author | louis <louis.braun@gmx.de> | 2013-03-10 17:06:41 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-03-10 17:06:41 +0100 |
commit | f4e23b8daa1d959bbb9ef5a8d4253412a15ff013 (patch) | |
tree | b190021a6361affedb5250cedfc4ab57470d1194 /displaychannel.c | |
parent | 3d4c1d84b7cd2ca23e3fda446a30b55a1d4878d9 (diff) | |
download | skin-nopacity-f4e23b8daa1d959bbb9ef5a8d4253412a15ff013.tar.gz skin-nopacity-f4e23b8daa1d959bbb9ef5a8d4253412a15ff013.tar.bz2 |
Position of channel logos in channel display now configurable
Diffstat (limited to 'displaychannel.c')
-rw-r--r-- | displaychannel.c | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/displaychannel.c b/displaychannel.c index eb050ca..c2b3226 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -67,8 +67,20 @@ void cNopacityDisplayChannel::SetGeometry(void) { height = cOsd::OsdHeight() * config.channelHeight / 100; int top = cOsd::OsdTop() + cOsd::OsdHeight() - height - config.channelBorderBottom; osd = CreateOsd(cOsd::OsdLeft(), top, cOsd::OsdWidth(), height); - infoWidth = osd->Width() - (config.logoWidth + 2 * config.channelBorderVertical + config.logoBorder); - infoX = config.logoWidth + config.channelBorderVertical + config.logoBorder; + switch (config.logoPosition) { + case lpLeft: + infoWidth = osd->Width() - (config.logoWidth + 2 * config.channelBorderVertical + config.logoBorder); + infoX = config.logoWidth + config.channelBorderVertical + config.logoBorder; + break; + case lpRight: + infoWidth = osd->Width() - (config.logoWidth + 2 * config.channelBorderVertical + config.logoBorder); + infoX = config.channelBorderVertical; + break; + case lpNone: + infoWidth = osd->Width() - 2 * config.channelBorderVertical; + infoX = config.channelBorderVertical; + break; + } channelInfoWidth = infoWidth * 0.7; dateWidth = infoWidth - channelInfoWidth; channelInfoHeight = height * 0.2; @@ -83,7 +95,6 @@ void cNopacityDisplayChannel::SetGeometry(void) { streamInfoY = channelInfoHeight + progressBarHeight + epgInfoHeight; iconSize = config.statusIconSize; iconsWidth = 5*iconSize; - } void cNopacityDisplayChannel::CreatePixmaps(void) { @@ -104,7 +115,20 @@ void cNopacityDisplayChannel::CreatePixmaps(void) { pixmapFooter = osd->CreatePixmap(2, cRect(infoX, streamInfoY, infoWidth, streamInfoHeight)); pixmapStreamInfo = osd->CreatePixmap(4, cRect(infoX + (infoWidth - iconsWidth - config.resolutionIconSize - 35), height - iconSize - 10, iconsWidth, iconSize)); pixmapStreamInfoBack = osd->CreatePixmap(3, cRect(infoX + (infoWidth - iconsWidth - config.resolutionIconSize - 35), height - iconSize - 10, iconsWidth, iconSize)); - pixmapLogo = osd->CreatePixmap(1, cRect(0, 0, config.logoWidth + 2 * config.logoBorder, height)); + + switch (config.logoPosition) { + case lpLeft: + pixmapLogo = osd->CreatePixmap(1, cRect(0, 0, config.logoWidth + 2 * config.logoBorder, height)); + break; + case lpRight: + pixmapLogo = osd->CreatePixmap(1, cRect(infoX + infoWidth, 0, config.logoWidth + 2 * config.logoBorder, height)); + break; + case lpNone: + pixmapLogo = osd->CreatePixmap(-1, cRect(0, 0, 1, 1)); + break; + } + + if (config.channelFadeTime) { pixmapBackgroundTop->SetAlpha(0); @@ -358,10 +382,11 @@ void cNopacityDisplayChannel::SetChannel(const cChannel *Channel, int Number) { if (!groupSep) { pixmapChannelInfo->DrawText(cPoint(channelInfoHeight/2, (channelInfoHeight-fontHeader->Height())/2), channelString, Theme.Color(clrChannelHead), clrTransparent, fontHeader); - - cImageLoader imgLoader; - if (imgLoader.LoadLogo(*ChannelName)) { - pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage()); + if (config.logoPosition != lpNone) { + cImageLoader imgLoader; + if (imgLoader.LoadLogo(*ChannelName)) { + pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage()); + } } } else { if (withInfo) { @@ -371,11 +396,13 @@ void cNopacityDisplayChannel::SetChannel(const cChannel *Channel, int Number) { } else { pixmapChannelInfo->DrawText(cPoint(channelInfoHeight/2, (channelInfoHeight-fontHeader->Height())/2), channelString, Theme.Color(clrChannelHead), clrTransparent, fontHeader); } - cImageLoader imgLoader; - if (imgLoader.LoadLogo(*ChannelName)) { - pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage()); - } else if (imgLoader.LoadIcon("Channelseparator", config.logoHeight)) { - pixmapLogo->DrawImage(cPoint(config.logoBorder + (config.logoWidth - config.logoHeight)/2, (height-config.logoHeight)/2), imgLoader.GetImage()); + if (config.logoPosition != lpNone) { + cImageLoader imgLoader; + if (imgLoader.LoadLogo(*ChannelName)) { + pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage()); + } else if (imgLoader.LoadIcon("Channelseparator", config.logoHeight)) { + pixmapLogo->DrawImage(cPoint(config.logoBorder + (config.logoWidth - config.logoHeight)/2, (height-config.logoHeight)/2), imgLoader.GetImage()); + } } } } |