From 8f8511a612212efbe301e8a0790ff14f954abd57 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 12:23:50 +0200 Subject: [PATCH] - epgplus: use getItemColors() to get global item colors --- src/gui/epgplus.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 6df2babfc..293bb5f1b 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -307,11 +307,18 @@ bool EpgPlus::ChannelEventEntry::isSelected(time_t _selectedTime) const void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor) { - this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), - this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENT_PLUS_1))); + if (this->channelEvent.description.empty()) + pisSelected = false; + + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, pisSelected, false, toggleColor); + + this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), bgcolor); this->font->RenderString(this->x + OFFSET_INNER_SMALL, this->y + this->font->getHeight(), - this->width - 2*OFFSET_INNER_SMALL > 0 ? this->width - 2*OFFSET_INNER_SMALL : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); + this->width - 2*OFFSET_INNER_SMALL > 0 ? this->width - 2*OFFSET_INNER_SMALL : 0, this->channelEvent.description, color); // paint the separation lines if (separationLineThickness > 0) @@ -407,11 +414,15 @@ EpgPlus::ChannelEntry::~ChannelEntry() void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) { - this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), - isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, isSelected); + + this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), bgcolor); this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(), - this->width - 2*OFFSET_INNER_MID, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT); + this->width - 2*OFFSET_INNER_MID, this->displayName, color); if (isSelected) {