From c04a374a6b465caace1625a416101585e09d62ac Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 9 May 2010 18:45:58 +0000 Subject: [PATCH] patch for width logos git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@576 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0dd250e707e4f186edee2c665d7eb496a2b5bac7 Author: Jacek Jendrzej Date: 2010-05-09 (Sun, 09 May 2010) ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 11 ++++++++--- src/gui/eventlist.cpp | 12 ++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index b68eda75e..10c2a5531 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -578,9 +578,14 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start tallchans_iterator cit = allchans.find(channel_id); if(cit != allchans.end()) { std::string lname; - if(g_PicViewer->GetLogoName(channel_id, cit->second.getName(), lname)) { - g_PicViewer->DisplayImage(lname, sx+10, sy + (toph-PIC_H)/2/*5*/, PIC_W, PIC_H); - pic_offx = PIC_W + 10; + 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 > PIC_H) + logo_h = PIC_H; + + 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 b62ba5efd..7446bda6a 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -692,12 +692,16 @@ void EventList::paintHead(t_channel_id channel_id, std::string channelname) frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); std::string lname; - if(g_PicViewer->GetLogoName(channel_id, channelname, lname)) - logo_ok = g_PicViewer->DisplayImage(lname, x+10, y+(theight-PIC_H)/2, PIC_W, PIC_H); - + int logo_w = 0; + int logo_h = 0; + if(g_PicViewer->GetLogoName(channel_id, channelname, lname, &logo_w, &logo_h)){ + if(logo_h > PIC_H) + logo_h = PIC_H; + logo_ok = g_PicViewer->DisplayImage(lname, x+10, y+(theight-logo_h)/2, logo_w, logo_h); + } //logo_ok = g_PicViewer->DisplayLogo(channel_id, x+10, y+(theight-PIC_H)/2, PIC_W, PIC_H); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+15+(logo_ok? 5+PIC_W:0),y+theight+1, width, name.c_str(), COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+15+(logo_ok? 5+logo_w:0),y+theight+1, width, name.c_str(), COL_MENUHEAD, 0, true); // UTF-8 } void EventList::paint(t_channel_id channel_id)