- bouqueteditor_bouquets: use getItemColors function

This commit is contained in:
svenhoefer
2016-10-19 10:06:35 +02:00
parent 3a80241b0c
commit cd20c34e98

View File

@@ -66,27 +66,37 @@ CBEBouquetWidget::CBEBouquetWidget()
void CBEBouquetWidget::paintItem(int pos) void CBEBouquetWidget::paintItem(int pos)
{ {
fb_pixel_t color;
fb_pixel_t bgcolor;
int ypos = y+ theight+0 + pos*iheight; int ypos = y+ theight+0 + pos*iheight;
unsigned int current = liststart + pos; unsigned int current = liststart + pos;
if (current == selected) { bool i_selected = current == selected;
color = COL_MENUCONTENTSELECTED_TEXT; int i_radius = RADIUS_NONE;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); fb_pixel_t color;
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); fb_pixel_t bgcolor;
} else {
getItemColors(color, bgcolor, i_selected);
if (i_selected)
{
i_radius = RADIUS_LARGE;
}
else
{
bool has_channels = true; bool has_channels = true;
if(current < Bouquets->size()) if(current < Bouquets->size())
has_channels = (!(*Bouquets)[current]->tvChannels.empty() ) || (!(*Bouquets)[current]->radioChannels.empty()); has_channels = (!(*Bouquets)[current]->tvChannels.empty() ) || (!(*Bouquets)[current]->radioChannels.empty());
color = has_channels ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT;
bgcolor = has_channels ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; if (!has_channels)
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); color = COL_MENUCONTENTINACTIVE_TEXT;
} }
if(current < Bouquets->size()) { if (i_radius)
if ((current == selected) && (state == beMoving)) frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0);
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, i_radius);
if (current < Bouquets->size()) {
if ((i_selected) && (state == beMoving))
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight);
if ((*Bouquets)[current]->bHidden) if ((*Bouquets)[current]->bHidden)