From be9c56d3b138fe2ce5734dd1426b2c51e4e94b32 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 17 Feb 2022 21:51:19 +0100 Subject: [PATCH] eventlist: supplement to: eventlist: use footer object as class member Additional fix to paint when button text was changed. --- src/gui/eventlist.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 0d3c76e48..b6819b551 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -1070,7 +1070,27 @@ void CEventList::paintFoot(t_channel_id channel_id) buttons[btn_cnt].locale = LOCALE_TIMERLIST_NAME; btn_cnt++; - if (!footer.isPainted() || btn_cnt != (int)footer.getButtonChainObject()->size()) + // paint footer only on changed content + bool repaint = false; + size_t btn_size = 0; + if (footer.getButtonChainObject()) + { + btn_size = footer.getButtonChainObject()->size(); + if (btn_cnt == (int)btn_size) + { + for(size_t i=0; i < btn_size; i++) + { + CComponentsButton *btn = static_cast (footer.getButtonChainObject()->getCCItem(i)); + if (g_Locale->getString(buttons[i].locale) != btn->getCaptionString()) + { + repaint = true; + break; + } + } + } + } + + if (!footer.isPainted() || btn_cnt != (int)btn_size || repaint) footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons); }