EpgPlus: simplify calls of logo attributes and logo instance

This commit is contained in:
2017-04-24 08:30:52 +02:00
parent 220829ffaa
commit 7b19ea1fd1
2 changed files with 13 additions and 8 deletions

View File

@@ -111,20 +111,23 @@ void EpgPlus::Header::paint(const char * Name)
std::string caption = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD);
if (this->head == NULL)
{
this->head = new CComponentsHeader();
this->head->setContextButton(CComponentsHeader::CC_BTN_HELP);
this->head->enableClock(true, "%H:%M", "%H %M", true);
}
if (this->head)
{
if (g_settings.channellist_show_channellogo)
{
// ensure to have clean background
this->head->getChannelLogoObject()->hide();
this->head->getChannelLogoObject()->allowPaint(false);
this->logo = this->head->getChannelLogoObject();
this->logo->hide();
this->logo->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);
this->head->enableClock(true, "%H:%M", "%H %M", true);
this->head->paint(CC_SAVE_SCREEN_NO);
}
}
@@ -136,14 +139,14 @@ void EpgPlus::Header::paintChannelLogo(const CZapitChannel * Channel)
if (this->head)
{
this->head->getChannelLogoObject()->hide();
this->head->getChannelLogoObject()->clearSavedScreen();
this->logo->hide();
this->logo->clearSavedScreen();
if (Channel)
{
this->head->setChannelLogo(Channel->getChannelID(), Channel->getName());
}
this->head->getChannelLogoObject()->allowPaint(true);
this->head->getChannelLogoObject()->paint();
this->logo->allowPaint(true);
this->logo->paint();
}
}