diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 3072ac78e..d27ca88cc 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2200,9 +2200,7 @@ void CChannelList::paintHead() else logo_off = 10; - if (header->isPainted()) //clean up background of header for new contents - header->kill(header->getColorBody(), -1, CC_FBDATA_TYPES, false); - header->paint0(); + header->paint(CC_SAVE_SCREEN_NO); } CComponentsHeader* CChannelList::getHeaderObject() diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 9d3544573..7442352e7 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -344,6 +344,9 @@ void CComponentsForm::paintForm(bool do_save_bg) void CComponentsForm::paint(bool do_save_bg) { + if(is_painted) + OnBeforeRePaint(); + OnBeforePaint(); paintForm(do_save_bg); } diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 56ad077c6..b9cab7934 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -68,7 +68,9 @@ class CComponentsForm : public CComponentsItem ///force repaint of all possible text items void forceItemsPaint(bool force); ///slot for background paint event, reserved for forceItemsPaint() - sigc::slot0 sl_repaint; + sigc::slot0 sl_items_repaint; + ///slot for repaint event, reserved for actions before repaint if paint() already was done. + sigc::slot0 sl_form_repaint; public: CComponentsForm( const int x_pos = 0, const int y_pos = 0, const int w = 800, const int h = 600, diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index c3995318d..fcce3647e 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -101,7 +101,7 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, cl_sl_show = sigc::mem_fun0(*this, &CComponentsFrmClock::ShowTime); //init slot to ensure paint segments after painted background - sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsFrmClock::forceItemsPaint), true); + sl_items_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsFrmClock::forceItemsPaint), true); //run clock already if required if (activ) @@ -304,7 +304,7 @@ void CComponentsFrmClock::initCCLockItems() if(!OnAfterPaintBg.empty()) OnAfterPaintBg.clear(); //init slot to handle repaint of segments if background was repainted - OnAfterPaintBg.connect(sl_repaint); + OnAfterPaintBg.connect(sl_items_repaint); } diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 3abf816f4..420ea2775 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -115,7 +115,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; //init slot to ensure paint text items after painted background - sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsExtTextForm::forceItemsPaint), true); + sl_items_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsExtTextForm::forceItemsPaint), true); initParent(parent); @@ -226,7 +226,7 @@ void CComponentsExtTextForm::initCCTextItems() if(!OnAfterPaintBg.empty()) OnAfterPaintBg.clear(); //init slot to handle repaint of text if background was repainted - OnAfterPaintBg.connect(sl_repaint); + OnAfterPaintBg.connect(sl_items_repaint); } void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index dcc22dfc2..3a0f530a4 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -136,8 +136,13 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; - //init slot to ensure paint segments after painted background - sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsHeader::forceItemsPaint), true); + //init slot to ensure paint items after painted background + sl_items_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsHeader::forceItemsPaint), true); + OnAfterPaintBg.connect(sl_items_repaint); + + //init slot before re paint of header, paint() is already done + sl_form_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsHeader::kill), col_body, -1, CC_FBDATA_TYPES, false); + OnBeforeRePaint.connect(sl_form_repaint); addContextButton(buttons); initCCItems(); @@ -523,11 +528,6 @@ void CComponentsHeader::initCaption() */ //height = max(height, cch_text_obj->getHeight()); } - - if(!OnAfterPaintBg.empty()) - OnAfterPaintBg.clear(); - //init slot to handle repaint of text if background was repainted - OnAfterPaintBg.connect(sl_repaint); } void CComponentsHeader::initCCItems() diff --git a/src/gui/components/cc_signals.h b/src/gui/components/cc_signals.h index da6a6d8b2..c3c60727e 100644 --- a/src/gui/components/cc_signals.h +++ b/src/gui/components/cc_signals.h @@ -113,6 +113,8 @@ class CComponentsSignals : public sigc::trackable ///signal on before paint() sigc::signal OnBeforePaint; + ///signal on before repaint, means: paint() is already done and item paint() is called again + sigc::signal OnBeforeRePaint; ///signal on after paint() sigc::signal OnAfterPaint; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 244850330..89243b967 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1274,8 +1274,6 @@ void CMenuWidget::paint() header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); header->enableGradientBgCleanUp(savescreen); - if (header->isPainted()) - header->kill(header->getColorBody()); header->paint(CC_SAVE_SCREEN_NO); // paint body shadow