mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CComponentsFooter: ignore item, if no text and icon are defined
Empty buttons with defined width are causing gaps...looks not nice!
This commit is contained in:
@@ -128,11 +128,19 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont
|
|||||||
|
|
||||||
//generate and add button objects passed from button label content with default width to chain object.
|
//generate and add button objects passed from button label content with default width to chain object.
|
||||||
for (size_t i= 0; i< label_count; i++){
|
for (size_t i= 0; i< label_count; i++){
|
||||||
CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, height-height/4, content[i].text, content[i].button);
|
string txt = content[i].text;
|
||||||
|
string btn_name = string(content[i].button);
|
||||||
|
|
||||||
|
//ignore item, if no text and icon are defined;
|
||||||
|
if (txt.empty() && btn_name.empty()){
|
||||||
|
dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] ignore item [%d], no icon and text defined!\n", __func__, __LINE__, i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, height-height/4, txt, btn_name);
|
||||||
btn->setButtonFont(ccf_btn_font);
|
btn->setButtonFont(ccf_btn_font);
|
||||||
btn->doPaintBg(btn_contour);
|
btn->doPaintBg(btn_contour);
|
||||||
|
|
||||||
string btn_name = string(content[i].button);
|
|
||||||
if (btn_name == NEUTRINO_ICON_BUTTON_RED)
|
if (btn_name == NEUTRINO_ICON_BUTTON_RED)
|
||||||
btn->setColorFrame(COL_DARK_RED);
|
btn->setColorFrame(COL_DARK_RED);
|
||||||
if (btn_name == NEUTRINO_ICON_BUTTON_GREEN)
|
if (btn_name == NEUTRINO_ICON_BUTTON_GREEN)
|
||||||
@@ -220,8 +228,8 @@ void CComponentsFooter::paintButtons(const int& x_pos,
|
|||||||
{
|
{
|
||||||
this->setDimensionsAll(x_pos, y_pos, w, h);
|
this->setDimensionsAll(x_pos, y_pos, w, h);
|
||||||
this->setButtonFont(font);
|
this->setButtonFont(font);
|
||||||
this->setButtonLabels(content, label_count, 0, label_width);
|
|
||||||
this->setContextButton(context_buttons);
|
this->setContextButton(context_buttons);
|
||||||
|
this->setButtonLabels(content, label_count, 0, label_width);
|
||||||
|
|
||||||
this->paint(do_save_bg);
|
this->paint(do_save_bg);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user