eventlist: optimize button paint on changed caption content

Paint not complete footer but only button which content has been changed.

another supplement to:
	eventlist: use footer object as class member
This commit is contained in:
2022-02-19 21:29:30 +01:00
parent 75e646335b
commit 82a04ed87c

View File

@@ -1071,7 +1071,6 @@ void CEventList::paintFoot(t_channel_id channel_id)
btn_cnt++; btn_cnt++;
// paint footer only on changed content // paint footer only on changed content
bool repaint = false;
size_t btn_size = 0; size_t btn_size = 0;
if (footer.getButtonChainObject()) if (footer.getButtonChainObject())
{ {
@@ -1083,14 +1082,15 @@ void CEventList::paintFoot(t_channel_id channel_id)
CComponentsButton *btn = static_cast<CComponentsButton*> (footer.getButtonChainObject()->getCCItem(i)); CComponentsButton *btn = static_cast<CComponentsButton*> (footer.getButtonChainObject()->getCCItem(i));
if (g_Locale->getString(buttons[i].locale) != btn->getCaptionString()) if (g_Locale->getString(buttons[i].locale) != btn->getCaptionString())
{ {
repaint = true; btn->setCaption(buttons[i].locale);
break; btn->hide();
btn->paint();
} }
} }
} }
} }
if (!footer.isPainted() || btn_cnt != (int)btn_size || repaint) if (!footer.isPainted() || btn_cnt != (int)btn_size)
footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons); footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons);
} }