From 82a04ed87c1d20c258c26da5084182d608100193 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 19 Feb 2022 21:29:30 +0100 Subject: [PATCH] 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 --- src/gui/eventlist.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index b6819b551..e0383ca34 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -1071,7 +1071,6 @@ void CEventList::paintFoot(t_channel_id channel_id) btn_cnt++; // paint footer only on changed content - bool repaint = false; size_t btn_size = 0; if (footer.getButtonChainObject()) { @@ -1083,14 +1082,15 @@ void CEventList::paintFoot(t_channel_id channel_id) CComponentsButton *btn = static_cast (footer.getButtonChainObject()->getCCItem(i)); if (g_Locale->getString(buttons[i].locale) != btn->getCaptionString()) { - repaint = true; - break; + btn->setCaption(buttons[i].locale); + 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); }