- channellist: remove color-mess in progressbar code; don't change colors when moving cursor

This commit is contained in:
svenhoefer
2016-10-10 14:19:54 +02:00
parent 4598e320a6
commit abd3f97e9d

View File

@@ -1983,32 +1983,15 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str()); l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str());
int pb_space = prg_offset - title_offset; int pb_space = prg_offset - title_offset;
CProgressBar pb(x+5+numwidth + title_offset, ypos + fheight/4 + 2, pb_space + 2, fheight/2 - 4, int pb_height = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getDigitHeight();
0, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_INFOBAR_PLUS_7, COL_INFOBAR_PLUS_3); CProgressBar pb(x+5+numwidth + title_offset, ypos + (fheight-pb_height)/2, pb_space + 2, pb_height, COL_MENUCONTENT_PLUS_0);
pb.setType(CProgressBar::PB_TIMESCALE); pb.setType(CProgressBar::PB_TIMESCALE);
pb.setDesign(g_settings.channellist_progressbar_design); pb.setDesign(g_settings.channellist_progressbar_design);
pb.setCornerType(0); pb.setCornerType(0);
pb.setFrameThickness(0); // no frame pb.setStatusColors(COL_MENUCONTENT_PLUS_3, COL_MENUCONTENT_PLUS_1);
pb.doPaintBg(false); // no background pb.setFrameThickness(g_settings.channellist_progressbar_design == CProgressBar::PB_MONO ? 1 : 0);
pb.doPaintBg(false);
int pb_max = pb_space - 4; int pb_max = pb_space - 4;
if (g_settings.progressbar_design != CProgressBar::PB_MONO) {
if (liststart + pos != selected) {
fb_pixel_t pbgcol = COL_MENUCONTENT_PLUS_1;
if (pbgcol == bgcolor)
pbgcol = COL_MENUCONTENT_PLUS_0;
pb.setStatusColors(COL_MENUCONTENT_PLUS_3, pbgcol);
} else {
fb_pixel_t pbgcol = COL_MENUCONTENTSELECTED_PLUS_0;
if (pbgcol == bgcolor)
pbgcol = COL_MENUCONTENT_PLUS_0;
pb.setStatusColors(COL_MENUCONTENTSELECTED_PLUS_2, pbgcol);
}
} else {
if (liststart + pos != selected)
pb.setStatusColors(COL_MENUCONTENT_PLUS_3, COL_MENUCONTENT_PLUS_1);
else
pb.setStatusColors(COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENTSELECTED_PLUS_0);
}
if (!(p_event->description.empty())) { if (!(p_event->description.empty())) {
snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - ");