From bd2f2cb849424a8a23c52ecfba7f7de9a8a5e24e Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 19 Oct 2016 13:21:58 +0200 Subject: [PATCH] - listframe/moviebrowser: use getItemColors function --- src/gui/widget/listframe.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index ad6a7520d..3e34451d9 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -426,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 : COL_MENUCONTENTSELECTED_TEXT; - bgcolor = marked ? COL_MENUCONTENTSELECTED_PLUS_2 : COL_MENUCONTENTSELECTED_PLUS_0; + + 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 = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, y+m_cFrame.iY, m_cFrameListRel.iWidth, m_nFontListHeight, bgcolor, radius);