From 593f0dfe04136c6ed4bea2342d365abbc8a78698 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 15 Feb 2022 13:05:00 +0100 Subject: [PATCH] eventlist: use footer object as class member Allows to handle paint interval only on changed button count and avoids related possible flicker effects on unnecessary paint events. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/79d3fc7a5219fb9a95a5e244f595aed8fd55efaf Author: Thilo Graf Date: 2022-02-15 (Tue, 15 Feb 2022) ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 7 ++++--- src/gui/eventlist.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index cfeceaa03..b58a7f6d8 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -121,6 +121,7 @@ CEventList::CEventList() header = NULL; pb = NULL; navibar = NULL; + footer.enableShadow(CC_SHADOW_ON, -1, true); } CEventList::~CEventList() @@ -705,6 +706,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna void CEventList::hide() { ResetModules(); + footer.kill(); frameBuffer->paintBackgroundBoxRel(x, y, full_width + OFFSET_SHADOW, height + OFFSET_SHADOW); } @@ -1070,9 +1072,8 @@ void CEventList::paintFoot(t_channel_id channel_id) buttons[btn_cnt].locale = LOCALE_TIMERLIST_NAME; btn_cnt++; - CComponentsFooter footer; - footer.enableShadow(CC_SHADOW_ON, -1, true); - footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons); + if (!footer.isPainted() || btn_cnt != (int)footer.getButtonChainObject()->size()) + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons); } // -- Eventlist Menu Handler Class diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 9bbd5a4b4..1eef0d0eb 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -79,6 +79,7 @@ class CEventList : public CListHelpers CFrameBuffer *frameBuffer; CChannelEventList evtlist; CTimerd::TimerList timerlist; + CComponentsFooter footer; void readEvents(const t_channel_id channel_id); unsigned int selected; unsigned int current_event;