diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index de34c6063..7ebf586db 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -115,6 +115,12 @@ void EpgPlus::Header::paint(const char * Name) if (this->head) { + if (g_settings.channellist_show_channellogo) + { + // ensure to have clean background + this->head->getChannelLogoObject()->hide(); + this->head->getChannelLogoObject()->allowPaint(false); + } this->head->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight()); this->head->setCaption(caption, CTextBox::NO_AUTO_LINEBREAK); this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); @@ -123,6 +129,24 @@ void EpgPlus::Header::paint(const char * Name) } } +void EpgPlus::Header::paintChannelLogo(const CZapitChannel * Channel) +{ + if (!g_settings.channellist_show_channellogo) + return; + + if (this->head) + { + this->head->getChannelLogoObject()->hide(); + this->head->getChannelLogoObject()->clearSavedScreen(); + if (Channel) + { + this->head->setChannelLogo(Channel->getChannelID(), Channel->getName()); + } + this->head->getChannelLogoObject()->allowPaint(true); + this->head->getChannelLogoObject()->paint(); + } +} + int EpgPlus::Header::getUsedHeight() { return font->getHeight(); @@ -368,7 +392,7 @@ int EpgPlus::ChannelEventEntry::getUsedHeight() Font *EpgPlus::ChannelEntry::font = NULL; int EpgPlus::ChannelEntry::separationLineThickness = 0; -EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth) +EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Header * pheader, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth) { this->channel = pchannel; @@ -383,6 +407,7 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, this->index = pindex; this->frameBuffer = pframeBuffer; + this->header = pheader; this->footer = pfooter; this->bouquetList = pbouquetList; @@ -510,6 +535,8 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) detailsLine->setDimensionsAll(xPos, yPosTop, yPosBottom, this->font->getHeight()/2, this->footer->getUsedHeight() - RADIUS_LARGE*2); detailsLine->paint(false); + + this->header->paintChannelLogo(this->channel); } } @@ -644,7 +671,7 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex) CZapitChannel * channel = (*this->channelList)[i]; - ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth); + ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->header, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth); //printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); CChannelEventList channelEventList; CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList); diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 29a6c5e89..f5a0ee65f 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -84,6 +84,8 @@ class EpgPlus void paint(const char * Name = NULL); + void paintChannelLogo(const CZapitChannel * Channel = NULL); + static int getUsedHeight(); //// attributes @@ -192,6 +194,7 @@ class EpgPlus ChannelEntry(const CZapitChannel* channel, int index, CFrameBuffer* frameBuffer, + Header* header, Footer* footer, CBouquetList* bouquetList, int x, @@ -216,6 +219,7 @@ class EpgPlus int index; CFrameBuffer* frameBuffer; + Header* header; Footer* footer; CBouquetList* bouquetList;