diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index c25d9cc86..ea2bdb856 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1522,86 +1522,52 @@ void CAudioPlayerGui::paintItem(int pos) return; int ypos = m_y + m_title_height + m_theight + pos*m_fheight; - int c_rad_small; + unsigned int currpos = m_liststart + pos; + + bool i_selected = currpos == m_selected; + bool i_marked = currpos == (unsigned) m_current; + bool i_switch = false; //(currpos < m_playlist.size()) && (pos & 1); + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - if ((pos + m_liststart) == m_selected) - { - if ((pos + m_liststart) == (unsigned)m_current) - { - color = COL_MENUCONTENTSELECTED_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_2; - } - else - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); + + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; + + if (i_selected) paintItemID3DetailsLine(pos); - c_rad_small = RADIUS_SMALL; - } - else - { -//NI - don't darken every second entry -#if 0 - if (((pos + m_liststart) < m_playlist.size()) && (pos & 1)) - { - if ((pos + m_liststart) == (unsigned)m_current) - { - color = COL_MENUCONTENTDARK_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENTDARK_PLUS_2; - } - else - { - color = COL_MENUCONTENTDARK_TEXT; - bgcolor = COL_MENUCONTENTDARK_PLUS_0; - } - } - else -#endif - { - if ((pos + m_liststart) == (unsigned)m_current) - { - color = COL_MENUCONTENT_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENT_PLUS_2; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - } - c_rad_small = 0; - } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, COL_MENUCONTENT_PLUS_0); - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor, c_rad_small); + if (i_radius) + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor, i_radius); - if ((pos + m_liststart) < m_playlist.size()) + if (currpos < m_playlist.size()) { char sNr[20]; - sprintf(sNr, "%2d : ", pos + m_liststart + 1); + sprintf(sNr, "%2d : ", currpos + 1); std::string tmp = sNr; - getFileInfoToDisplay(tmp, m_playlist[pos + m_liststart]); + getFileInfoToDisplay(tmp, m_playlist[currpos]); char dura[9]; if (m_inetmode) - snprintf(dura, 8, "%ldk", m_playlist[pos + m_liststart].MetaData.total_time); + snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); else - snprintf(dura, 8, "%ld:%02ld", m_playlist[pos + m_liststart].MetaData.total_time / 60, - m_playlist[pos + m_liststart].MetaData.total_time % 60); + snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, + m_playlist[currpos].MetaData.total_time % 60); int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura) + 5; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, tmp, color, m_fheight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, w, dura, color, m_fheight); - if ((pos + m_liststart) == m_selected) + if (currpos == m_selected) { if (m_state == CAudioPlayerGui::STOP) - CVFD::getInstance()->showAudioTrack(m_playlist[pos + m_liststart].MetaData.artist, - m_playlist[pos + m_liststart].MetaData.title, - m_playlist[pos + m_liststart].MetaData.album); + CVFD::getInstance()->showAudioTrack(m_playlist[currpos].MetaData.artist, + m_playlist[currpos].MetaData.title, + m_playlist[currpos].MetaData.album); } } } @@ -1891,6 +1857,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) ibox->setCorner(RADIUS_LARGE); ibox->setColorFrame(COL_FRAME_PLUS_0); ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + ibox->setTextColor(COL_MENUCONTENTDARK_TEXT); ibox->forceTextPaint(false); } diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 8d5f5f64c..4138c987d 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -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) diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index cc326390e..6046663e4 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -94,35 +94,40 @@ CBEChannelWidget::~CBEChannelWidget() void CBEChannelWidget::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; + bool i_selected = current == selected; + int i_radius = RADIUS_NONE; - if(current < Channels->size()) { - initItem2DetailsLine (pos, current); + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected); + + if (i_selected) + { + if (current < Channels->size()) + { + initItem2DetailsLine(pos, current); paintDetails(current); } - - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); - } else { - if(current < Channels->size() && ((*Channels)[current]->flags & CZapitChannel::NOT_PRESENT )) - color = COL_MENUCONTENTINACTIVE_TEXT;// extra color for channels not found in service - else - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); + i_radius = RADIUS_LARGE; } + else + { + if (current < Channels->size() && ((*Channels)[current]->flags & CZapitChannel::NOT_PRESENT)) + color = COL_MENUCONTENTINACTIVE_TEXT; + } + + 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 == selected) && (state == beMoving)) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight); } - if(current < Channels->size()) { + if (current < Channels->size()) { if ((*Channels)[current]->bLocked) { frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 22, ypos, iheight); } @@ -133,7 +138,6 @@ void CBEChannelWidget::paintItem(int pos) frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight); else if (!(*Channels)[current]->getUrl().empty()) frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x+width- 15 - 28, ypos, fheight); - } } @@ -220,6 +224,7 @@ void CBEChannelWidget::paintDetails(int index) //info box ibox->setText(str, CTextBox::AUTO_WIDTH | CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + ibox->setTextColor(COL_MENUCONTENTDARK_TEXT); ibox->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 4ec7621fc..79896b0b1 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -106,33 +106,32 @@ bool CBEChannelSelectWidget::hasChanged() void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselected) { int ypos = y+ theight + paintNr*iheight; + int i_radius = RADIUS_NONE; fb_pixel_t color; fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, pselected); + if (pselected) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - - if(itemNr < getItemCount()) { + if (itemNr < getItemCount()) + { initItem2DetailsLine (paintNr, itemNr); paintDetails(itemNr); } - - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); + i_radius = RADIUS_LARGE; } else { if (itemNr < getItemCount() && (Channels[itemNr]->flags & CZapitChannel::NOT_PRESENT)) color = COL_MENUCONTENTINACTIVE_TEXT; - else - color = COL_MENUCONTENT_TEXT; - - bgcolor = COL_MENUCONTENT_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); } + 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(itemNr < getItemCount()) { if( isChannelInBouquet(itemNr)) @@ -283,6 +282,7 @@ void CBEChannelSelectWidget::paintDetails(int index) //info box ibox->setText(str, CTextBox::AUTO_WIDTH | CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + ibox->setTextColor(COL_MENUCONTENTDARK_TEXT); ibox->paint(false); } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 999fa59fb..b8c395f70 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -364,25 +364,16 @@ void CBookmarkManager::paintItem(int pos) { int ypos = y+ theight+0 + pos*fheight*2; + unsigned int currpos = liststart + pos; + + bool i_selected = currpos == selected; + bool i_marked = false; + bool i_switch = false; //(currpos < bookmarks.size()) && (pos & 1); + fb_pixel_t color; fb_pixel_t bgcolor; - if (pos & 1) - { - color = COL_MENUCONTENTDARK_TEXT; - bgcolor = COL_MENUCONTENTDARK_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - - if (liststart + pos == selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); int real_width=width; if (bookmarks.size()>listmaxshow) @@ -391,14 +382,14 @@ void CBookmarkManager::paintItem(int pos) } frameBuffer->paintBoxRel(x,ypos, real_width, 2*fheight, bgcolor); - if (liststart+posRenderString(x+10,ypos+fheight, real_width-10, theBookmark.getName(), color, fheight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, real_width-10, theBookmark.getUrl(), color, fheight); // LCD Display - if (liststart+pos==selected) + if (i_selected) { CVFD::getInstance()->showMenuText(0, theBookmark.getName(), -1, true); // UTF-8 CVFD::getInstance()->showMenuText(1, theBookmark.getUrl(), -1, true); // UTF-8 diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 0e4cb6ce7..0aecfbd47 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -625,30 +625,47 @@ void CBouquetList::hide() void CBouquetList::paintItem(int pos) { int ypos = y+ theight+0 + pos*fheight; - fb_pixel_t color; - fb_pixel_t bgcolor; bool iscurrent = true; int npos = liststart + pos; const char * lname = NULL; - if(npos < (int) Bouquets.size()) + bool i_selected = npos == (int) 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; + + if (i_radius) + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor); + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, i_radius); + + if (npos < (int) Bouquets.size()) lname = (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bFav) ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : Bouquets[npos]->channelList->getName(); - if (npos == (int) selected) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); + if (i_selected) + { if(npos < (int) Bouquets.size()) CVFD::getInstance()->showMenuText(0, lname, -1, true); //NI lcd4l-support if(g_settings.lcd4l_support) LCD4l->CreateFile("/tmp/lcd/menu", lname, g_settings.lcd4l_convert); - } else { + } + else + { if(!favonly && (npos < (int) Bouquets.size())) iscurrent = !Bouquets[npos]->channelList->isEmpty(); - color = iscurrent ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor); + + if (!iscurrent) + { + //inactive colors? Is this correct? + color = COL_MENUCONTENTINACTIVE_TEXT; + //bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; + } } if(npos < (int) Bouquets.size()) { diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 2f0e6352b..bc1697fcd 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1558,7 +1558,7 @@ void CChannelList::paintDetails(int index) bool colored_event_C = (g_settings.theme.colored_events_channellist == 1); bool colored_event_N = (g_settings.theme.colored_events_channellist == 2); - frameBuffer->paintBoxRel(x, y + height, full_width, info_height, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round //NI + frameBuffer->paintBoxRel(x, y + height, full_width, info_height, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); frameBuffer->paintBoxFrame(x, y + height, full_width, info_height, 1, COL_FRAME_PLUS_0, RADIUS_LARGE); //NI if ((*chanlist).empty()) @@ -1871,12 +1871,9 @@ void CChannelList::paintItem(int pos, const bool firstpaint) return; } int ypos = y+ theight + pos*fheight; - fb_pixel_t color; - fb_pixel_t bgcolor; bool is_available = true; bool paintbuttons = false; unsigned int curr = liststart + pos; - fb_pixel_t c_radius = 0; if (curr < (*chanlist).size()) { @@ -1889,49 +1886,48 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if (selected >= (*chanlist).size()) selected = (*chanlist).size()-1; - unsigned int is_tuned = (getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber() && new_zap_mode != 2 /*active*/); + bool i_selected = curr == selected; + bool i_marked = getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber() && new_zap_mode != 2 /*active*/; + int i_radius = RADIUS_NONE; - if (curr == selected) + fb_pixel_t color; + fb_pixel_t ecolor; // we need one more color for displayNext + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected, i_marked); + ecolor = color; + + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; + + if (i_selected) { - if (is_tuned) - { - color = COL_MENUCONTENTSELECTED_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_2; - } - else - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } paintItem2DetailsLine (pos); paintDetails(curr); paintAdditionals(curr); - c_radius = RADIUS_LARGE; paintbuttons = true; } - else - { - if (is_tuned) - { - //NI - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_1; + //NI #if 0 - color = !displayNext ? COL_MENUCONTENT_TEXT_PLUS_2 : COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = !displayNext ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENTINACTIVE_PLUS_0; -#endif - c_radius = RADIUS_LARGE; - } + if (displayNext) + { + /* + I think it's unnecessary to change colors in this case. + The user should know when he has pressed the blue button. + */ + if (g_settings.theme.colored_events_channellist == 2 /* next */) + ecolor = COL_COLORED_EVENTS_TEXT; else - { - color = is_available ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = is_available ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; - } + ecolor = COL_MENUCONTENTINACTIVE_TEXT; } +#endif - if(!firstpaint || (curr == selected) || getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber()) - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, c_radius); + if (!is_available) + color = COL_MENUCONTENTINACTIVE_TEXT; + + if (!firstpaint || i_selected || getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber()) + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius); if(curr < (*chanlist).size()) { char nameAndDescription[255]; @@ -1939,8 +1935,6 @@ void CChannelList::paintItem(int pos, const bool firstpaint) CZapitChannel* chan = (*chanlist)[curr]; int prg_offset=0; int title_offset=0; - fb_pixel_t tcolor=(liststart + pos == selected) ? color : COL_MENUCONTENTINACTIVE_TEXT; - int xtheight=fheight-2; int rec_mode; if(g_settings.channellist_progressbar_design != CProgressBar::PB_OFF) { @@ -2047,10 +2041,10 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if(g_settings.channellist_progressbar_design != CProgressBar::PB_OFF) { if(displayNext) { - struct tm *pStartZeit = localtime(&p_event->startTime); + struct tm *pStartZeit = localtime(&p_event->startTime); snprintf(tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -prg_offset, tmp, tcolor); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos + fheight, width- numwidth- 20- 15 -prg_offset, tmp, ecolor, fheight); } else { @@ -2070,11 +2064,11 @@ void CChannelList::paintItem(int pos, const bool firstpaint) g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color); if (g_settings.channellist_epgtext_align_right) { // align right - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT)); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, ecolor); } else { // align left - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT)); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, ecolor); } } else { diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 4b632f3d3..56382340d 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -228,3 +228,31 @@ void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv) hsv->s = f_S; hsv->v = f_V; } + +void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected, bool marked, bool switch_background) +{ + if (selected && marked) + { + t = COL_MENUCONTENTSELECTED_TEXT_PLUS_2; + b = COL_MENUCONTENTSELECTED_PLUS_2; + return; + } + + if (selected) + { + t = COL_MENUCONTENTSELECTED_TEXT; + b = COL_MENUCONTENTSELECTED_PLUS_0; + return; + } + + if (marked) + { + t = COL_MENUCONTENT_TEXT_PLUS_2; + b = COL_MENUCONTENT_PLUS_2; + return; + } + + // default + t = switch_background ? COL_MENUCONTENTDARK_TEXT : COL_MENUCONTENT_TEXT; + b = switch_background ? COL_MENUCONTENTDARK_PLUS_0 : COL_MENUCONTENT_PLUS_0; +} diff --git a/src/gui/color.h b/src/gui/color.h index 8d7d09a36..52a84005e 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -71,7 +71,6 @@ #define COL_MENUCONTENTDARK_PLUS_0 (COL_MENUCONTENTDARK + 0) #define COL_MENUCONTENTDARK_PLUS_2 (COL_MENUCONTENTDARK + 2) #define COL_MENUCONTENTSELECTED_PLUS_0 (COL_MENUCONTENTSELECTED + 0) -#define COL_MENUCONTENTSELECTED_PLUS_1 (COL_MENUCONTENTSELECTED + 1) //NI #define COL_MENUCONTENTSELECTED_PLUS_2 (COL_MENUCONTENTSELECTED + 2) #define COL_MENUCONTENTINACTIVE_PLUS_0 (COL_MENUCONTENTINACTIVE + 0) #define COL_MENUFOOT_PLUS_0 (COL_MENUFOOT + 0) @@ -96,7 +95,6 @@ #define COL_MENUCONTENTDARK_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTDARK + 0)]) #define COL_MENUCONTENTDARK_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTDARK + 2)]) #define COL_MENUCONTENTSELECTED_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 0)]) -#define COL_MENUCONTENTSELECTED_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 1)]) //NI #define COL_MENUCONTENTSELECTED_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 2)]) #define COL_MENUCONTENTINACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTINACTIVE + 0)]) #define COL_MENUFOOT_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUFOOT + 0)]) @@ -163,4 +161,6 @@ uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv); void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb); void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv); +void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected = false, bool marked = false, bool switch_background = false); + #endif diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 54f02b680..80b4d09d2 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -710,40 +710,32 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { + int ypos = y+ theight+0 + pos*fheight; + unsigned int currpos = liststart + pos; + + bool i_selected = currpos == selected; + bool i_marked = currpos == current_event; + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - int ypos = y+ theight+0 + pos*fheight; - unsigned int curpos = liststart + pos; - if(RADIUS_LARGE) - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0, 0); + getItemColors(color, bgcolor, i_selected, i_marked); - if (curpos==selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else if (curpos == current_event ) - { - color = COL_MENUCONTENT_TEXT_PLUS_1; - bgcolor = COL_MENUCONTENT_PLUS_1; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; - if (!RADIUS_LARGE || (curpos==selected && RADIUS_LARGE) || (curpos==current_event && RADIUS_LARGE)) - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); + if (i_radius) + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, i_radius); - if(curposgetText(CLocaleManager::getWeekday(tmStartZeit)); datetime1_str += strftime(", %H:%M", tmStartZeit); @@ -752,12 +744,12 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { - t_channel_id channel = evtlist[curpos].channelID; + t_channel_id channel = evtlist[currpos].channelID; datetime1_str += " "; datetime1_str += CServiceManager::getInstance()->GetServiceName(channel); } - snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[curpos].duration / 60, unit_short_minute); + snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[currpos].duration / 60, unit_short_minute); duration_str = tmpstr; } @@ -766,7 +758,7 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color); - int seit = ( evtlist[curpos].startTime - time(NULL) ) / 60; + int seit = ( evtlist[currpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (!duration_str.empty()) ) { char beginnt[100]; @@ -778,9 +770,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) // 2nd line // set status icons - t_channel_id channel_tmp = m_showChannel ? evtlist[curpos].channelID : channel_idI; + t_channel_id channel_tmp = m_showChannel ? evtlist[currpos].channelID : channel_idI; int timerID = -1; - CTimerd::CTimerEventTypes etype = isScheduled(channel_tmp, &evtlist[curpos],&timerID); + CTimerd::CTimerEventTypes etype = isScheduled(channel_tmp, &evtlist[currpos],&timerID); const char * icontype = etype == CTimerd::TIMER_ZAPTO ? NEUTRINO_ICON_ZAP : 0; if(etype == CTimerd::TIMER_RECORD){ icontype = NEUTRINO_ICON_REC;// NEUTRINO_ICON_RECORDING_EVENT_MARKER @@ -795,21 +787,21 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // detecting timer conflict and set start position of event text depending of possible painted icon - bool conflict = HasTimerConflicts(evtlist[curpos].startTime, evtlist[curpos].duration, &item_event_ID); + bool conflict = HasTimerConflicts(evtlist[currpos].startTime, evtlist[currpos].duration, &item_event_ID); int i2w = 0, i2h; - //printf ("etype %d , conflicts %d -> %s, conflict event_ID %d -> current event_ID %d\n", etype, conflict, evtlist[curpos].description.c_str(), item_event_ID, evtlist[curpos].eventID); + //printf ("etype %d , conflicts %d -> %s, conflict event_ID %d -> current event_ID %d\n", etype, conflict, evtlist[currpos].description.c_str(), item_event_ID, evtlist[currpos].eventID); //TODO: solution for zapto timer events - if (conflict && item_event_ID != evtlist[curpos].eventID) + if (conflict && item_event_ID != evtlist[currpos].eventID) { //paint_warning = true; - frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); - frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x+iw+7, ypos + fheight1+3 - (fheight1 - i2h)/2, fheight1); - iw += i2w+4; + frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); + frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x+iw+7, ypos + fheight1+3 - (fheight1 - i2h)/2, fheight1); + iw += i2w+4; } // paint 2nd line text - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+10+iw, ypos+ fheight, width- 25- 20 -iw, evtlist[curpos].description, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+10+iw, ypos+ fheight, width- 25- 20 -iw, evtlist[currpos].description, color); } } diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 2d0a59565..96f4c78fe 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1168,38 +1168,32 @@ void CFileBrowser::hide() void CFileBrowser::paintItem(unsigned int pos) { int colwidth1, colwidth2, colwidth3; - int c_rad_small = 0; - fb_pixel_t color; - fb_pixel_t bgcolor; int ypos = y+ theight+0 + pos*fheight; CFile * actual_file = NULL; std::string fileicon; - unsigned int curr = liststart + pos; + unsigned int currpos = liststart + pos; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0/*DARK*/); - - if (curr >= filelist.size()) + if (currpos >= filelist.size()) return; - actual_file = &filelist[curr]; - if (curr == selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; //NI - bgcolor = actual_file->Marked ? COL_MENUCONTENTSELECTED_PLUS_2 : COL_MENUCONTENTSELECTED_PLUS_0; - c_rad_small = RADIUS_SMALL; - } - else if (actual_file->Marked) - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_2; - } - else - { - color = COL_MENUCONTENT_TEXT;//DARK; - bgcolor = COL_MENUCONTENT_PLUS_0;//DARK; - } + actual_file = &filelist[currpos]; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, c_rad_small); + bool i_selected = currpos == selected; + bool i_marked = actual_file->Marked; + bool i_switch = false; //(currpos < filelist.size()) && (pos & 1); + int i_radius = RADIUS_NONE; + + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); + + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; + + if (i_radius) + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius); if (g_settings.filebrowser_showrights == 0 && S_ISREG(actual_file->Mode)) colwidth2 = 0; @@ -1210,7 +1204,7 @@ void CFileBrowser::paintItem(unsigned int pos) if ( !actual_file->Name.empty() ) { - if (curr == selected) + if (currpos == selected) CVFD::getInstance()->showMenuText(0, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()).c_str(), -1, true); // UTF-8 switch(actual_file->getType()) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 9e4a99087..7ab819762 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -680,39 +680,33 @@ void CPictureViewerGui::paintItem(int pos) // printf("paintItem{\n"); int ypos = y+ theight + 0 + pos*fheight; + unsigned int currpos = liststart + pos; + + bool i_selected = currpos == selected; + bool i_marked = false; + bool i_switch = false; //(currpos < playlist.size()) && (pos & 1); + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; -//NI - don't darken every second entry -#if 0 - if ((liststart+pos < playlist.size()) && (pos & 1) ) - { - color = COL_MENUCONTENTDARK_TEXT; - bgcolor = COL_MENUCONTENTDARK_PLUS_0; - } - else -#endif - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); - if (liststart+pos == selected) - { - frameBuffer->paintBoxRel(x,ypos, width-15, fheight, bgcolor); - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; - frameBuffer->paintBoxRel(x, ypos, width-15, fheight, bgcolor, liststart+pos == selected ? RADIUS_LARGE : 0); - if (liststart+pospaintBoxRel(x, ypos, width - 15, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - 15, fheight, bgcolor, i_radius); + + if (currpos < playlist.size()) { - std::string tmp = playlist[liststart+pos].Name; + std::string tmp = playlist[currpos].Name; tmp += " ("; - tmp += playlist[liststart+pos].Type; + tmp += playlist[currpos].Type; tmp += ')'; char timestring[18]; - strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[liststart+pos].Date)); + strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[currpos].Date)); int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(timestring); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, width-30 - w, tmp, color, fheight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+width-20-w,ypos+fheight, w, timestring, color, fheight); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 93042de3d..b1b55c48e 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -659,36 +659,36 @@ void CTimerList::paintItem(int pos) { int ypos = y+ theight+ pos*fheight*2; - fb_pixel_t color; - fb_pixel_t bgcolor; - int real_width=width; if (timerlist.size() > listmaxshow) { real_width-=15; //scrollbar } - color = COL_MENUCONTENT_TEXT; - if (pos & 1) - bgcolor = COL_MENUCONTENT_PLUS_1; - else - bgcolor = COL_MENUCONTENT_PLUS_0; + unsigned int currpos = liststart + pos; + + bool i_selected = currpos == (unsigned) selected; + bool i_marked = false; + bool i_switch = false; //pos & 1; + int i_radius = RADIUS_NONE; + + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); + + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; + + if (i_radius) + frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, bgcolor, i_radius); //shadow frameBuffer->paintBoxRel(x + width, ypos, OFFSET_SHADOW, 2*fheight, COL_SHADOW_PLUS_0); - //item - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, bgcolor); - if (liststart + pos == selected) + if (currpos < timerlist.size()) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - //selected item - frameBuffer->paintBoxRel(x,ypos, real_width, 2*fheight, bgcolor, RADIUS_MID); - - if (liststart + pos < (int)timerlist.size()) - { - CTimerd::responseGetTimer & timer = timerlist[liststart+pos]; + CTimerd::responseGetTimer & timer = timerlist[currpos]; char zAlarmTime[25] = {0}; struct tm *alarmTime = localtime(&(timer.alarmTime)); strftime(zAlarmTime,20,"%d.%m. %H:%M",alarmTime); @@ -803,7 +803,7 @@ void CTimerList::paintItem(int pos) } g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+2*fheight, real_width-(fw*13+5), zAddData, color, fheight); // LCD Display - if (liststart+pos==selected) + if (currpos == (unsigned) selected) { std::string line1 = convertTimerType2String(timer.eventType); // UTF-8 //std::string line2 = zAlarmTime; diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 1bbdd4916..efb171a2d 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -101,6 +101,7 @@ void CUpnpBrowserGui::Init() infobox.enableFrame(true, 1); //NI infobox.setCorner(RADIUS_LARGE); infobox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0); + infobox.setTextColor(COL_MENUCONTENTDARK_TEXT); infobox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); infobox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); infobox.enableShadow(CC_SHADOW_ON, -1, true); @@ -108,6 +109,7 @@ void CUpnpBrowserGui::Init() timebox.enableFrame(true, 1); //NI timebox.setCorner(RADIUS_LARGE); timebox.setColorAll(infobox.getColorFrame(), infobox.getColorBody()); + timebox.setTextColor(infobox.getTextColor()); timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); timebox.enableShadow(CC_SHADOW_ON, -1, true); @@ -955,22 +957,25 @@ void CUpnpBrowserGui::paintDeviceInfo() void CUpnpBrowserGui::paintDevice(unsigned int _pos) { int ypos = m_item_y + _pos*m_item_height; + unsigned int pos = m_deviceliststart + _pos; + + bool i_selected = pos == m_selecteddevice; + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - unsigned int pos = m_deviceliststart + _pos; - if (pos == m_selecteddevice) + getItemColors(color, bgcolor, i_selected); + + if (i_selected) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; paintDeviceInfo(); + i_radius = RADIUS_LARGE; } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor); + + if (i_radius) + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius); if (pos >= m_devices.size()) return; @@ -1024,27 +1029,28 @@ void CUpnpBrowserGui::paintDevices() void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int pos, unsigned int selected) { int ypos = m_item_y + pos*m_item_height; + + bool i_selected = pos == selected; + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - if (pos == selected) - { - color = COL_MENUCONTENT_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENT_PLUS_2; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor); + getItemColors(color, bgcolor, i_selected); + + if (i_selected) + i_radius = RADIUS_LARGE; + + if (i_radius) + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius); if (pos >= (*entries).size()) return; UPnPEntry *entry = &(*entries)[pos]; - if (pos == selected) + if (i_selected) { paintItemInfo(entry); paintDetails(entry); @@ -1312,8 +1318,7 @@ void CUpnpBrowserGui::playVideo(std::string name, std::string url) { CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); - if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) - CAudioPlayer::getInstance()->stop(); + stopAudio(); m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index 02b1706c2..c564e2c5a 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -715,19 +715,10 @@ void CKeyboardInput::paintChar(int pos, std::string &c) fb_pixel_t color; fb_pixel_t bgcolor; - if (pos == selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, pos == selected); - frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, COL_MENUCONTENT_PLUS_2); - frameBuffer->paintBoxRel(xpos+ 1, ypos+ 1, input_w- 2, input_h- 2, bgcolor); + frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, bgcolor); + frameBuffer->paintBoxFrame(xpos, ypos, input_w, input_h, 1, COL_MENUCONTENT_PLUS_2); int ch_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(c); int ch_x = xpos + std::max(input_w/2 - ch_w/2, 0); @@ -749,17 +740,14 @@ void CKeyboardInput::paintKey(int row, int column) //key_y = y+ hheight+ offset+ input_h+ offset; int ypos = key_y + (key_h + KEY_BORDER)*row; + int i_selected = (focus == FOCUS_KEY && row == srow && column == scol); + fb_pixel_t color; fb_pixel_t bgcolor; - if (focus == FOCUS_KEY && row == srow && column == scol) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } else { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - int radius = CORNER_RADIUS_SMALL; + getItemColors(color, bgcolor, i_selected); + + int radius = RADIUS_SMALL; frameBuffer->paintBoxRel(xpos, ypos, key_w, key_h, bgcolor, radius); frameBuffer->paintBoxFrame(xpos, ypos, key_w, key_h, KEY_FRAME_WIDTH, COL_FRAME_PLUS_0, radius); diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 4c722aaf3..fb10993c8 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -126,16 +126,7 @@ void CListBox::paintItem(unsigned int /*itemNr*/, int paintNr, bool pselected) fb_pixel_t color; fb_pixel_t bgcolor; - if (pselected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, pselected); frameBuffer->paintBoxRel(x,ypos, width- 15, getItemHeight(), bgcolor); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 10, ypos+ fheight, width-20, "demo", color); diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 2e2d168bf..a2dee004a 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -66,17 +66,11 @@ #define MIN_WINDOW_WIDTH (frameBuffer->getScreenWidth() >> 1) #define MIN_WINDOW_HEIGHT 40 -#define TITLE_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUHEAD_PLUS_0) -#define HEADER_LIST_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUCONTENT_PLUS_0) -#define LIST_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUCONTENT_PLUS_0) -//#define LIST_BACKGROUND_COLOR_SELECTED ((CFBWindow::color_t)COL_MENUCONTENT_PLUS_1) -#define LIST_BACKGROUND_COLOR_SELECTED ((CFBWindow::color_t)COL_MENUCONTENTSELECTED_PLUS_0) - +#define TITLE_BACKGROUND_COLOR COL_MENUHEAD_PLUS_0 #define TITLE_FONT_COLOR COL_MENUHEAD_TEXT + +#define HEADER_LIST_BACKGROUND_COLOR COL_MENUCONTENT_PLUS_0 #define HEADER_LIST_FONT_COLOR COL_MENUCONTENT_TEXT -#define LIST_FONT_COLOR COL_MENUCONTENT_TEXT -//#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENT_TEXT -#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENTSELECTED_TEXT #define FONT_LIST g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2] #define FONT_HEADER_LIST g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1] @@ -360,7 +354,7 @@ void CListFrame::refreshTitle(void) if( frameBuffer == NULL) return; frameBuffer->paintBoxRel(m_cFrameTitleRel.iX+m_cFrame.iX, m_cFrameTitleRel.iY+m_cFrame.iY, - m_cFrameTitleRel.iWidth, m_cFrameTitleRel.iHeight, g_settings.theme.menu_Head_gradient ? LIST_BACKGROUND_COLOR : TITLE_BACKGROUND_COLOR); //NI + m_cFrameTitleRel.iWidth, m_cFrameTitleRel.iHeight, g_settings.theme.menu_Head_gradient ? COL_MENUCONTENT_PLUS_0 : TITLE_BACKGROUND_COLOR); //NI m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + TEXT_BORDER_WIDTH + m_cFrame.iX, m_cFrameTitleRel.iY + m_cFrameTitleRel.iHeight + m_cFrame.iY, @@ -410,7 +404,7 @@ void CListFrame::refreshList(void) //TRACE("[CListFrame]->refreshList: %d\r\n",m_nCurrentLine); if( frameBuffer == NULL) return; frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, m_cFrameListRel.iY+m_cFrame.iY, - m_cFrameListRel.iWidth, m_cFrameListRel.iHeight, LIST_BACKGROUND_COLOR); + m_cFrameListRel.iWidth, m_cFrameListRel.iHeight, COL_MENUCONTENT_PLUS_0); if( m_nNrOfLines <= 0) return; @@ -432,27 +426,19 @@ void CListFrame::refreshLine(int line) if((line < m_nCurrentLine) && (line > m_nCurrentLine + m_nLinesPerPage)) return; - uint32_t color, bgcolor; + fb_pixel_t color, bgcolor; int rel_line = line - m_nCurrentLine; int y = m_cFrameListRel.iY + TEXT_BORDER_WIDTH + (rel_line*m_nFontListHeight); int radius = 0; + bool selected = (line == m_nSelectedLine && m_showSelection == true); bool marked = (!m_pLines->marked.empty() && m_pLines->marked[line]); - if(line == m_nSelectedLine && m_showSelection == true) - { - color = marked ? COL_MENUCONTENTINACTIVE_TEXT : LIST_FONT_COLOR_SELECTED; - bgcolor = marked ? COL_MENUCONTENTSELECTED_PLUS_2 : LIST_BACKGROUND_COLOR_SELECTED; + + getItemColors(color, bgcolor, selected, marked); + + if (selected || marked) radius = RADIUS_LARGE; - } - else if (marked) { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_2; - } - else - { - color = LIST_FONT_COLOR; - bgcolor = LIST_BACKGROUND_COLOR; - } + frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, y+m_cFrame.iY, m_cFrameListRel.iWidth, m_nFontListHeight, bgcolor, radius); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 1468f1913..b09473bef 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1000,6 +1000,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) default: if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); + retval = menu_return::RETURN_EXIT_ALL; + msg = CRCInput::RC_timeout; } else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { retval = menu_return::RETURN_EXIT_ALL; @@ -1497,6 +1499,7 @@ void CMenuWidget::paintHint(int pos) info_box->setText(str, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT], COL_MENUCONTENT_TEXT); info_box->setCorner(RADIUS_LARGE); info_box->setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + info_box->setTextColor(COL_MENUCONTENTDARK_TEXT); info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_MENUFOOT_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);// COL_MENUFOOT_PLUS_0 is default footer color diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 79b10c6c9..0df5f2966 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -601,19 +601,10 @@ void CStringInput::paintChar(int pos, const char c) fb_pixel_t color; fb_pixel_t bgcolor; - if (pos == selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, pos == selected); - frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, COL_MENUCONTENT_PLUS_2); - frameBuffer->paintBoxRel(xpos+ 1, ypos+ 1, input_w- 2, input_h- 2, bgcolor); + frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, bgcolor); + frameBuffer->paintBoxFrame(xpos, ypos, input_w, input_h, 1, COL_MENUCONTENT_PLUS_2); int ch_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(ch); int ch_x = xpos + std::max(input_w/2 - ch_w/2, 0); diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 2d04e833b..4b4923e00 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -350,19 +350,10 @@ void CExtendedInput_Item_Char::paint(int x, int y, bool focusGained ) fb_pixel_t color; fb_pixel_t bgcolor; - if (focusGained) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, focusGained); - frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, COL_MENUCONTENT_PLUS_2); - frameBuffer->paintBoxRel(xpos+ 1, ypos+ 1, input_w- 2, input_h- 2, bgcolor); + frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, bgcolor); + frameBuffer->paintBoxFrame(xpos, ypos, input_w, input_h, 1, COL_MENUCONTENT_PLUS_2); int ch_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(ch); int ch_x = xpos + std::max(input_w/2 - ch_w/2, 0);