From 89d373ed0578432bad3ad58d217465bcdbdcdfb5 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 19 Oct 2016 10:06:35 +0200 Subject: [PATCH] - bookmarkmanager: use getItemColors function --- src/gui/bookmarkmanager.cpp | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 57f48fde3..cad6d739d 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