From abdf32c6391736608b3deac4bb9dd467d2b372ee Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH] CComponentsHeader: add methode initRepaintSlot() and considered parent Required in sub classes. Considering of parent ensures usage of required background color in sub classes. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3e342a7661562312fb4677a35268f4f7190913ed Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) --- src/gui/components/cc_frm_header.cpp | 12 ++++++++---- src/gui/components/cc_frm_header.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f66b7a387..acdee9363 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -136,13 +136,17 @@ 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 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(); initParent(parent); + + //init repaint slot before re paint of body, if paint() is already done + initRepaintSlot(); +} + +void CComponentsHeader::initRepaintSlot(){ + sl_form_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsHeader::kill), cc_parent ? col_body : 0, -1, CC_FBDATA_TYPES, false); + OnBeforeRePaint.connect(sl_form_repaint); } CComponentsHeader::~CComponentsHeader() diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 7f75f2fd7..eb4a6d607 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -112,6 +112,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen void initButtons(); ///sub: init clock object void initClock(); + ///int repaint slot + void initRepaintSlot(); public: enum