mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 23:13:00 +02:00
cc_button_select: add member setSelectedButton() without text color args
Origin commit data
------------------
Commit: edb80246d9
Author: Thilo Graf <dbt@novatux.de>
Date: 2020-12-07 (Mon, 07 Dec 2020)
This commit is contained in:
@@ -48,7 +48,7 @@ int CCButtonSelect::getSelectedButton()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCButtonSelect::setSelectedButton( size_t item_id,
|
void CCButtonSelect::SetSelectedButton( size_t item_id,
|
||||||
const fb_pixel_t& sel_fr_col,
|
const fb_pixel_t& sel_fr_col,
|
||||||
const fb_pixel_t& fr_col,
|
const fb_pixel_t& fr_col,
|
||||||
const fb_pixel_t& sel_bg_col,
|
const fb_pixel_t& sel_bg_col,
|
||||||
@@ -64,7 +64,7 @@ void CCButtonSelect::setSelectedButton( size_t item_id,
|
|||||||
CComponentsItem *item = btn_container->getCCItem(i);
|
CComponentsItem *item = btn_container->getCCItem(i);
|
||||||
if (item->getItemType() >= CC_ITEMTYPE_BUTTON && item->getItemType() <= CC_ITEMTYPE_BUTTON_BLUE){
|
if (item->getItemType() >= CC_ITEMTYPE_BUTTON && item->getItemType() <= CC_ITEMTYPE_BUTTON_BLUE){
|
||||||
btn = static_cast<CComponentsButton*>(item);
|
btn = static_cast<CComponentsButton*>(item);
|
||||||
btn->setButtonTextColor(text_col);
|
btn->setButtonTextColor(text_col, sel_text_col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!btn){
|
if (!btn){
|
||||||
@@ -72,13 +72,23 @@ void CCButtonSelect::setSelectedButton( size_t item_id,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fb_pixel_t sel_col = fr_col;
|
setSelectedButton(item_id, sel_fr_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width);
|
||||||
if (btn_container->size() > 1)
|
getSelectedButtonObject()->setButtonTextColor(text_col, sel_text_col);
|
||||||
sel_col = sel_fr_col; //TODO: make it configurable
|
|
||||||
btn_container->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width);
|
|
||||||
|
|
||||||
getSelectedButtonObject()->setButtonTextColor(sel_text_col);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCButtonSelect::setSelectedButton( size_t item_id,
|
||||||
|
const fb_pixel_t& sel_fr_col,
|
||||||
|
const fb_pixel_t& fr_col,
|
||||||
|
const fb_pixel_t& sel_bg_col,
|
||||||
|
const fb_pixel_t& bg_col,
|
||||||
|
const int& frame_width,
|
||||||
|
const int& sel_frame_width)
|
||||||
|
{
|
||||||
|
fb_pixel_t sel_col = fr_col;
|
||||||
|
if (btn_container->size() > 1)
|
||||||
|
sel_col = sel_fr_col; //TODO: make it configurable
|
||||||
|
btn_container->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -68,8 +68,8 @@ class CCButtonSelect
|
|||||||
* @param[in] sel_frame_width
|
* @param[in] sel_frame_width
|
||||||
* @li optional: expects type int, default = 1
|
* @li optional: expects type int, default = 1
|
||||||
*/
|
*/
|
||||||
void setSelectedButton(size_t item_id,
|
void SetSelectedButton(size_t item_id,
|
||||||
const fb_pixel_t& sel_fr_col = COL_FRAME_PLUS_0,
|
const fb_pixel_t& sel_fr_col = COL_MENUCONTENTSELECTED_PLUS_0,
|
||||||
const fb_pixel_t& fr_col = COL_FRAME_PLUS_0,
|
const fb_pixel_t& fr_col = COL_FRAME_PLUS_0,
|
||||||
const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_0,
|
const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_0,
|
||||||
const fb_pixel_t& bg_col = COL_MENUCONTENT_PLUS_0,
|
const fb_pixel_t& bg_col = COL_MENUCONTENT_PLUS_0,
|
||||||
@@ -77,6 +77,32 @@ class CCButtonSelect
|
|||||||
const fb_pixel_t& sel_text_col = COL_MENUCONTENTSELECTED_TEXT,
|
const fb_pixel_t& sel_text_col = COL_MENUCONTENTSELECTED_TEXT,
|
||||||
const int& frame_width = 1,
|
const int& frame_width = 1,
|
||||||
const int& sel_frame_width = 1);
|
const int& sel_frame_width = 1);
|
||||||
|
|
||||||
|
/**Select a definied button inside button chain object. Its the same functionality like SetSelectedButton() but without args for text colors.
|
||||||
|
* @param[in] item_id
|
||||||
|
* @li expects type size_t
|
||||||
|
* @param[in] sel_fr_col
|
||||||
|
* @li optional: expects type fb_pixel_t, as selected frame color
|
||||||
|
* @param[in] fr_col
|
||||||
|
* @li optional: expects type fb_pixel_t, as default frame color
|
||||||
|
* @param[in] sel_bg_col
|
||||||
|
* @li optional: expects type fb_pixel_t, as selected background color
|
||||||
|
* @param[in] bg_col
|
||||||
|
* @li optional: expects type fb_pixel_t, as default background color
|
||||||
|
* @param[in] frame_width
|
||||||
|
* @li optional: expects type int, default = 1
|
||||||
|
* @param[in] sel_frame_width
|
||||||
|
* @li optional: expects type int, default = 1
|
||||||
|
*
|
||||||
|
* @see SetSelectedButton()
|
||||||
|
*/
|
||||||
|
void setSelectedButton(size_t item_id,
|
||||||
|
const fb_pixel_t& sel_fr_col = COL_MENUCONTENTSELECTED_PLUS_0,
|
||||||
|
const fb_pixel_t& fr_col = COL_FRAME_PLUS_0,
|
||||||
|
const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_0,
|
||||||
|
const fb_pixel_t& bg_col = COL_MENUCONTENT_PLUS_0,
|
||||||
|
const int& frame_width = 1,
|
||||||
|
const int& sel_frame_width = 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__CC_BTN_SEL_H__
|
#endif //__CC_BTN_SEL_H__
|
||||||
|
Reference in New Issue
Block a user