- 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)
{
fb_pixel_t color;
fb_pixel_t bgcolor;
int ypos = y+ theight+0 + pos*iheight;
unsigned int current = liststart + pos;
if (current == selected) {
color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0);
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE);
} else {
bool i_selected = current == selected;
int i_radius = RADIUS_NONE;
fb_pixel_t color;
fb_pixel_t bgcolor;
getItemColors(color, bgcolor, i_selected);
if (i_selected)
{
i_radius = RADIUS_LARGE;
}
else
{
bool has_channels = true;
if(current < Bouquets->size())
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;
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor);
if (!has_channels)
color = COL_MENUCONTENTINACTIVE_TEXT;
}
if(current < Bouquets->size()) {
if ((current == selected) && (state == beMoving))
if (i_radius)
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);
if ((*Bouquets)[current]->bHidden)