From 0412a5aa23d197f160cd8e085743b02b6285b9ec Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 18 Sep 2017 22:53:27 +0200 Subject: [PATCH] menue: use getItemColors() to get item colors Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/477ece6ece2eb91fd8471db1b88a242f559640c3 Author: vanhofen Date: 2017-09-18 (Mon, 18 Sep 2017) Origin message was: ------------------ - menue: use getItemColors() to get item colors ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index b3cbbbb0c..6cf30cf8d 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -103,8 +103,8 @@ void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX) dx = DX; offx = OFFX; name_start_x = x + offx + icon_frame_w; - item_color = COL_MENUCONTENT_TEXT; - item_bgcolor = COL_MENUCONTENT_PLUS_0; + + getItemColors(item_color, item_bgcolor); } void CMenuItem::setActive(const bool Active) @@ -190,26 +190,13 @@ void CMenuItem::setItemButton(const char * const icon_Name, const bool is_select void CMenuItem::initItemColors(const bool select_mode) { - if (select_mode) - { - item_color = COL_MENUCONTENTSELECTED_TEXT; - item_bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else if (!active || inert) + getItemColors(item_color, item_bgcolor, select_mode, marked); + + if (!active || inert) { item_color = COL_MENUCONTENTINACTIVE_TEXT; item_bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - else if (marked) - { - item_color = COL_MENUCONTENT_TEXT; - item_bgcolor = COL_MENUCONTENT_PLUS_1; - } - else - { - item_color = COL_MENUCONTENT_TEXT; - item_bgcolor = COL_MENUCONTENT_PLUS_0; - } } void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text, const fb_pixel_t right_bgcol)