From edf48f0011bbf911adc9c396f6b76d543f90b960 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 26 Dec 2015 19:20:03 +0100 Subject: [PATCH] CStreamInfo2: try to fix wrong text colors Text color was not matching for background color. In some constellations with theme settings, text is not really good readable. COL_MENUCONTENT_... requires COL_MENUCONTENT_TEXT, not COL_INFOBAR_TEXT Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b86586bf6847bda3ac1d7da3a5859fb20cb409a5 Author: Thilo Graf Date: 2015-12-26 (Sat, 26 Dec 2015) --- src/gui/streaminfo2.cpp | 94 ++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 9fa937c87..d42532a6d 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -182,15 +182,15 @@ int CStreamInfo2::doSignalStrengthLoop () char currate[150]; snprintf(tmp_str,sizeof(tmp_str), "%s:",g_Locale->getText(LOCALE_STREAMINFO_BITRATE)); - g_Font[font_info]->RenderString(dx1 , average_bitrate_pos, offset+10, tmp_str, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString(dx1 , average_bitrate_pos, offset+10, tmp_str, COL_MENUCONTENT_TEXT); sprintf(currate, "%5llu.%02llu", rate.short_average / 1000ULL, rate.short_average % 1000ULL); frameBuffer->paintBoxRel (dx1 + average_bitrate_offset , average_bitrate_pos -dheight, sw, dheight, COL_MENUCONTENT_PLUS_0); - g_Font[font_info]->RenderString (dx1 + average_bitrate_offset , average_bitrate_pos, sw - 10, currate, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (dx1 + average_bitrate_offset , average_bitrate_pos, sw - 10, currate, COL_MENUCONTENT_TEXT); snprintf(tmp_str,sizeof(tmp_str), "(%s)",g_Locale->getText(LOCALE_STREAMINFO_AVERAGE_BITRATE)); - g_Font[font_info]->RenderString (dx1 + average_bitrate_offset + sw , average_bitrate_pos, sw *2, tmp_str, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (dx1 + average_bitrate_offset + sw , average_bitrate_pos, sw *2, tmp_str, COL_MENUCONTENT_TEXT); } if (!mp) { @@ -291,7 +291,7 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h) snprintf(tname, sizeof(tname), "%s: %d: %s", g_Locale->getText(LOCALE_STREAMINFO_SIGNAL), tuner, frontend->getName()); #endif - g_Font[font_small]->RenderString(_x, _y+iheight+15, width-_x-10, tname /*tuner_name.c_str()*/, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(_x, _y+iheight+15, width-_x-10, tname /*tuner_name.c_str()*/, COL_MENUCONTENT_TEXT); sigBox_x = _x; sigBox_y = _y+iheight+15; @@ -305,17 +305,17 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h) if (!mp) { frameBuffer->paintBoxRel(_x+xd*0,y1- 12,16,2, COL_RED); //red - g_Font[font_small]->RenderString(_x+20+xd*0, y1, fw*4, "BER", COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(_x+20+xd*0, y1, fw*4, "BER", COL_MENUCONTENT_TEXT); frameBuffer->paintBoxRel(_x+xd*1,y1- 12,16,2,COL_BLUE); //blue - g_Font[font_small]->RenderString(_x+20+xd*1, y1, fw*4, "SNR", COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(_x+20+xd*1, y1, fw*4, "SNR", COL_MENUCONTENT_TEXT); frameBuffer->paintBoxRel(_x+8+xd*2,y1- 12,16,2, COL_GREEN); //green - g_Font[font_small]->RenderString(_x+28+xd*2, y1, fw*4, "SIG", COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(_x+28+xd*2, y1, fw*4, "SIG", COL_MENUCONTENT_TEXT); } frameBuffer->paintBoxRel(_x+xd*3,y1- 12,16,2,COL_YELLOW); // near yellow - g_Font[font_small]->RenderString(_x+20+xd*3, y1, fw*5, "Bitrate", COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(_x+20+xd*3, y1, fw*5, "Bitrate", COL_MENUCONTENT_TEXT); sig_text_ber_x = _x + xd * 0; sig_text_snr_x = _x + 5 + xd * 1; @@ -330,9 +330,9 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h) else maxmin_x = _x + 40 + xd * 3 + (fontW*4); - g_Font[font_small]->RenderString(maxmin_x, y1 + sheight + 5, fw*3, "max", COL_INFOBAR_TEXT); - g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +5, fw*3, "now", COL_INFOBAR_TEXT); - g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +5, fw*3, "min", COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(maxmin_x, y1 + sheight + 5, fw*3, "max", COL_MENUCONTENT_TEXT); + g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +5, fw*3, "now", COL_MENUCONTENT_TEXT); + g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +5, fw*3, "min", COL_MENUCONTENT_TEXT); sigBox_pos = 0; @@ -431,7 +431,7 @@ void CStreamInfo2::SignalRenderStr(unsigned int value, int _x, int _y) fw *=(fw>17)?5:6; frameBuffer->paintBoxRel(_x, _y - sheight + 5, fw, sheight -1, COL_MENUCONTENT_PLUS_0); sprintf(str,"%6u",value); - g_Font[font_small]->RenderString(_x, _y + 5, fw, str, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(_x, _y + 5, fw, str, COL_MENUCONTENT_TEXT); } void CStreamInfo2::paint (int /*mode*/) @@ -521,14 +521,14 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) //Video RESOLUTION ypos += iheight; snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)); - g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); snprintf(buf, sizeof(buf), "%dx%d", xres, yres); - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //audio rate ypos += iheight; snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO)); - g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); switch (aspectRatio) { case 0: snprintf(buf, sizeof(buf), "N/A"); @@ -548,12 +548,12 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) default: strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_ARATIO_UNKNOWN), sizeof (buf)-1); } - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //Video FRAMERATE ypos += iheight; snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)); - g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); switch (framerate) { case 0: snprintf (buf,sizeof(buf), "23.976fps"); @@ -583,7 +583,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE_UNKNOWN), sizeof (buf)-1); break; } - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); // place for average bitrate average_bitrate_pos = ypos += iheight; //AUDIOTYPE @@ -592,7 +592,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode); snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)); - g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); if(type == AUDIO_FMT_MPEG) { const int max_mode = 4; @@ -625,21 +625,21 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) } else { snprintf(buf, sizeof(buf), "%s (%d)", g_Locale->getText(LOCALE_STREAMINFO_AUDIOTYPE_UNKNOWN), freq); } - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); if (mp) { //channel ypos += iheight; if (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) { snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_TIMERLIST_CHANNEL));//swiped locale - g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_MENUCONTENT_TEXT); snprintf(buf, sizeof(buf), "%s", channel->getName().c_str()); - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); } else { snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_MOVIEBROWSER_INFO_FILE));//swiped locale - g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_MENUCONTENT_TEXT); snprintf(buf, sizeof(buf), "%s", mp->GetFile().c_str()); - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); } scaling = 27000; @@ -656,19 +656,19 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) else if (CFrontend::isTerr(t.feparams.delsys)) snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_TERRESTRIALSETUP_AREA)); - g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); snprintf(buf, sizeof(buf), "%s", IS_WEBTV(channel->getChannelID()) ? g_Locale->getText(LOCALE_WEBTV_HEAD) : CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()).c_str()); - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //channel ypos += iheight; snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_TIMERLIST_CHANNEL));//swiped locale - g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_MENUCONTENT_TEXT); // process additional RealName if UserName exists >> uname.empty() ? realname : uname + realname snprintf(buf, sizeof(buf), "%s", (channel->getName()==channel->getRealname()) ? channel->getRealname().c_str():(channel->getName()+" << "+channel->getRealname()).c_str()); - g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //tsfrequenz ypos += iheight; @@ -678,8 +678,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) scaling = 15000; snprintf(buf, sizeof(buf), "%s",g_Locale->getText (LOCALE_SCANTS_FREQDATA)); - g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT); - g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width2, t.description().c_str(), COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_MENUCONTENT_TEXT); + g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width2, t.description().c_str(), COL_MENUCONTENT_TEXT); // paint labels int fontW = g_Font[font_small]->getWidth(); @@ -688,27 +688,27 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) //onid ypos+= sheight; snprintf(buf, sizeof(buf), "0x%04X (%i)", channel->getOriginalNetworkId(), channel->getOriginalNetworkId()); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_INFOBAR_TEXT); - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_MENUCONTENT_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //sid ypos+= sheight; snprintf(buf, sizeof(buf), "0x%04X (%i)", channel->getServiceId(), channel->getServiceId()); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_INFOBAR_TEXT); - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_MENUCONTENT_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //tsid ypos+= sheight; snprintf(buf, sizeof(buf), "0x%04X (%i)", channel->getTransportStreamId(), channel->getTransportStreamId()); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_INFOBAR_TEXT); - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_MENUCONTENT_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //pmtpid ypos+= sheight; pmt_version = channel->getPmtVersion(); snprintf(buf, sizeof(buf), "0x%04X (%i) [0x%02X]", channel->getPmtPid(), channel->getPmtPid(), pmt_version); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_INFOBAR_TEXT); - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_MENUCONTENT_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //vpid ypos+= sheight; @@ -717,12 +717,12 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) } else { snprintf(buf, sizeof(buf), "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE)); } - g_Font[font_small]->RenderString(xpos, ypos, box_width, "Vpid:" , COL_INFOBAR_TEXT); - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos, ypos, box_width, "Vpid:" , COL_MENUCONTENT_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); //apid ypos+= sheight; - g_Font[font_small]->RenderString(xpos, ypos, box_width, "Apid(s):" , COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos, ypos, box_width, "Apid(s):" , COL_MENUCONTENT_TEXT); if (g_RemoteControl->current_PIDs.APIDs.empty()){ snprintf(buf, sizeof(buf), "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE)); } else { @@ -734,7 +734,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) g_Font[font_small]->RenderString(xpos+sw, ypos, box_width2, buf, COL_MENUHEAD_TEXT); } else{ - g_Font[font_small]->RenderString(xpos+sw, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos+sw, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); } sw = g_Font[font_small]->getRenderWidth(buf)+sw+10; if (((li+1)%4 == 0) &&(g_RemoteControl->current_PIDs.APIDs.size()-1 > li)){ // if we have lots of apids, put "intermediate" line with pids @@ -750,8 +750,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) snprintf(buf, sizeof(buf), "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE)); else snprintf(buf, sizeof(buf), "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vtxtpid, g_RemoteControl->current_PIDs.PIDs.vtxtpid ); - g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_INFOBAR_TEXT); - g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_MENUCONTENT_TEXT); + g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); if(box_h == 0) box_h = ypos - ypos1; yypos = ypos; @@ -838,7 +838,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) if(caids[ca_id] == true){ if(cryptsysteme){ ypos += iheight; - g_Font[font_info]->RenderString(xpos , ypos, box_width, "Conditional access:" , COL_INFOBAR_TEXT); + g_Font[font_info]->RenderString(xpos , ypos, box_width, "Conditional access:" , COL_MENUCONTENT_TEXT); cryptsysteme = false; } ypos += sheight; @@ -851,7 +851,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) std::string::size_type last_pos = casys[ca_id].find_first_not_of(tok, 0); std::string::size_type pos = casys[ca_id].find_first_of(tok, last_pos); while (std::string::npos != pos || std::string::npos != last_pos){ - g_Font[font_small]->RenderString(xpos + width_txt, ypos, box_width, casys[ca_id].substr(last_pos, pos - last_pos).c_str() , COL_INFOBAR_TEXT); + g_Font[font_small]->RenderString(xpos + width_txt, ypos, box_width, casys[ca_id].substr(last_pos, pos - last_pos).c_str() , COL_MENUCONTENT_TEXT); if(index == 0) width_txt = spaceoffset; else @@ -1001,7 +1001,7 @@ void CStreamInfo2::showSNR () { signalbox = new CSignalBox(x + 10, yypos, 240, 50, frontend); signalbox->setColorBody(COL_MENUCONTENT_PLUS_0); - signalbox->setTextColor(COL_INFOBAR_TEXT); + signalbox->setTextColor(COL_MENUCONTENT_TEXT); signalbox->doPaintBg(true); }