From 3daae6d5691a3277cb0dcafbe6064b6fbee2fb73 Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 24 May 2011 15:11:35 +0000 Subject: [PATCH] dont show logo if without Logo git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1490 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/channellist.cpp | 22 ++++++++++++---------- src/gui/epgview.cpp | 13 ++++++------- src/gui/eventlist.cpp | 4 ++-- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index aa8672379..445ca5d14 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1711,19 +1711,21 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) void CChannelList::showChannelLogo() { - static int logo_w = 0; - static int logo_h = 0; - frameBuffer->paintBoxRel(x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); + if(g_settings.infobar_show_channellogo){ + static int logo_w = 0; + static int logo_h = 0; + frameBuffer->paintBoxRel(x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); - std::string lname; - if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname, &logo_w, &logo_h)) { - if(logo_h > theight) { - if((theight/(logo_h-theight))>1) { - logo_w -= (logo_w/(theight/(logo_h-theight))); + std::string lname; + if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname, &logo_w, &logo_h)) { + if(logo_h > theight) { + if((theight/(logo_h-theight))>1) { + logo_w -= (logo_w/(theight/(logo_h-theight))); + } + logo_h = theight; } - logo_h = theight; + g_PicViewer->DisplayImage(lname, x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); } - g_PicViewer->DisplayImage(lname, x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); } } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index d69424878..2da390770 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -605,14 +605,13 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start std::string lname; int logo_w = 0; int logo_h = 0; - if(g_PicViewer->GetLogoName(channel_id, cit->second.getName(), lname, &logo_w, &logo_h)) { - if(logo_h > toph){ - if((toph/(logo_h-toph))>1){ - logo_w -= (logo_w/(toph/(logo_h-toph))); + if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, cit->second.getName(), lname, &logo_w, &logo_h)) { + if(logo_h > toph){ + if((toph/(logo_h-toph))>1){ + logo_w -= (logo_w/(toph/(logo_h-toph))); + } + logo_h = toph; } - logo_h = toph; - } - g_PicViewer->DisplayImage(lname, sx+10, sy + (toph-logo_h)/2/*5*/, logo_w, logo_h); pic_offx = logo_w + 10; } diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 9d1717ac6..521c9a968 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -834,7 +834,7 @@ void EventList::paintHead(t_channel_id _channel_id, std::string _channelname) std::string lname; int logo_w = 0; int logo_h = 0; - if(g_PicViewer->GetLogoName(_channel_id, _channelname, lname, &logo_w, &logo_h)){ + if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(_channel_id, _channelname, lname, &logo_w, &logo_h)){ if(logo_h > theight){ if((theight/(logo_h-theight))>1){ logo_w -= (logo_w/(theight/(logo_h-theight))); @@ -843,7 +843,7 @@ void EventList::paintHead(t_channel_id _channel_id, std::string _channelname) } logo_ok = g_PicViewer->DisplayImage(lname, x+10, y+(theight-logo_h)/2, logo_w, logo_h); } - else + else g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+15+(logo_ok? 5+logo_w:0),y+theight+1, width, _channelname.c_str(), COL_MENUHEAD, 0, true); // UTF-8 }