CComponentsFooter: optimize select buttons, try to assign better contrast

Now it's possible to set parameters for frames and text.
Parameters are prdefined for better contrasts in select or default mode.

TODO: background modes have no effects at the moment. Here are other things need to be done.
This commit is contained in:
2016-10-23 17:08:51 +02:00
parent 969e2fe600
commit 55ac581523
2 changed files with 34 additions and 6 deletions

View File

@@ -345,13 +345,20 @@ void CComponentsFooter::enableButtonBg(bool enable)
}
}
void CComponentsFooter::setSelectedButton(size_t item_id)
void CComponentsFooter::setSelectedButton(size_t item_id, const fb_pixel_t& fr_col, const fb_pixel_t& sel_fr_col, const fb_pixel_t& bg_col, const fb_pixel_t& sel_bg_col, const fb_pixel_t& text_col, const fb_pixel_t& sel_text_col)
{
if (chain){
fb_pixel_t sel_col = COL_MENUCONTENTSELECTED_PLUS_2;
for (size_t i= 0; i< chain->size(); i++){
CComponentsButton *btn = static_cast<CComponentsButton*>(chain->getCCItem(i));
btn->setButtonTextColor(text_col);
}
fb_pixel_t sel_col = fr_col;
if (chain->size() > 1)
sel_col = COL_MENUCONTENTSELECTED_PLUS_0; //TODO: make it configurable
chain->setSelectedItem(item_id, sel_col, COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENT_PLUS_0, 1, 2);
sel_col = sel_fr_col; //TODO: make it configurable
chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, 1, 2);
if (chain->size() > 1)
getSelectedButtonObject()->setButtonTextColor(sel_text_col);
}
}