From 5ac5db718dd84b4594806d46ba9e6fc438452d14 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 1 May 2017 14:59:16 +0200 Subject: [PATCH 1/5] CCDraw: add methode do get current background save mode --- src/gui/components/cc_draw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 26b8875d5..0f23e7eb4 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -284,6 +284,8 @@ class CCDraw : public COSDFader, public CComponentsSignals virtual void enableSaveBg(bool save_bg = true); ///disable background buffering, does the same like enableSaveBg(false), NOTE: cleans existant pixbuffer content! virtual void disableSaveBg(){enableSaveBg(false);} + ///returns background buffering mode. Mode is assigned with paint() or enableSaveBg()/disableSaveBg()) + bool SaveBg(){return cc_save_bg;} ///allow/disalows paint of item and its contents, but initialize of other properties are not touched ///this can be understood as a counterpart to isPainted(), but before paint and value of is_painted is modified temporarily till next paint of item //TODO: is this sufficiently? From e7d60f7c08a59d7fe8c3e1f26b15b5ee3a82f4c3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 1 May 2017 15:01:32 +0200 Subject: [PATCH 2/5] CComponentsForm: use current bg save mode while paint items Mode was always false but current mode could be required in many constellations. --- src/gui/components/cc_frm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index bd1f4f555..15bf84e42 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -518,7 +518,7 @@ void CComponentsForm::paintCCItems() //finally paint current item, but only required contents of page if (cc_item->getPageNumber() == cur_page) - cc_item->paint(CC_SAVE_SCREEN_NO); + cc_item->paint(cc_item->SaveBg()); //restore defined old visibility mode of item after paint cc_item->allowPaint(item_visible); From 30b58f49409c91399df13aa4295081de81ddac6a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 2 May 2017 17:21:01 +0200 Subject: [PATCH 3/5] cc_types: add missing image types --- src/gui/components/cc_item_picture.h | 6 ++++-- src/gui/components/cc_types.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index ef8204d55..fe42604e7 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -208,7 +208,8 @@ class CComponentsPictureScalable : public CComponentsPicture fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE) - : CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){}; + : CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent) + {cc_item_type = CC_ITEMTYPE_PICTURE_SCALABLE;}; }; class CComponentsChannelLogo : public CComponentsPicture @@ -292,7 +293,8 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK) - : CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){}; + : CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent) + {cc_item_type = CC_ITEMTYPE_CHANNEL_LOGO_SCALABLE;}; }; #endif diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 297cc5b66..532aba066 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -41,7 +41,9 @@ typedef enum CC_ITEMTYPE_GENERIC, CC_ITEMTYPE_ITEM, CC_ITEMTYPE_PICTURE, + CC_ITEMTYPE_PICTURE_SCALABLE, CC_ITEMTYPE_CHANNEL_LOGO, + CC_ITEMTYPE_CHANNEL_LOGO_SCALABLE, CC_ITEMTYPE_TEXT, CC_ITEMTYPE_TEXT_INFOBOX, CC_ITEMTYPE_SHAPE_SQUARE, From 801d1beb1084d756daf0ae88d1a95de28f5551ab Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 2 May 2017 19:54:42 +0200 Subject: [PATCH 4/5] CComponentsForm: expand debug output with address. --- src/gui/components/cc_frm.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 15bf84e42..430423045 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -185,12 +185,11 @@ void CComponentsForm::clear() return; for(size_t i=0; igetItemType()); - - delete v_cc_items[i]; - v_cc_items[i] = NULL; + CComponentsItem *item = v_cc_items[i]; + if (item){ + dprintf(DEBUG_DEBUG, "[CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\taddress = %p\n", __func__, (int)i+1, (int)v_cc_items.size(), item->getItemType(), item); + delete item; + item = NULL; } } v_cc_items.clear(); From c482dd139f26e5db804e022921fd21a9b75c653b Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 1 May 2017 16:18:53 +0200 Subject: [PATCH 5/5] -cc_form_header: add max caption width picked from: https://github.com/TangoCash/neutrino-mp-cst-next commit: 4ff6c9f89b194c5fffdc4ee4e4eb744829be975f Signed-off-by: Thilo Graf review reqiured --- src/gui/components/cc_frm_header.cpp | 3 +++ src/gui/components/cc_frm_header.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index fff49031a..c633c74b9 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -144,6 +144,8 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; + cch_text_max_w = width; + addContextButton(buttons); initCCItems(); initParent(parent); @@ -562,6 +564,7 @@ void CComponentsHeader::initCaption() cch_cl_obj->allowPaint(cch_cl_enable); } + cc_text_w = min(cc_text_w,cch_text_max_w); //create cch_text_obj and add to collection if (cch_text_obj == NULL){ diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 9550d1134..16fa2ddd1 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -106,6 +106,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen int cch_icon_w; ///property: internal width for clock object int cch_clock_w; + ///property: internal max width for text object + int cch_text_max_w; ///property: internal x-position for caption object int cch_text_x; ///property: internal offset of context button icons within context button object @@ -191,6 +193,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen virtual Font* getCaptionFont(){return cch_font;} ///set text color for caption virtual void setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;} + ///set max width for caption + virtual void setCaptionMaxWidth(int max_width){cch_text_max_w = max_width;} enum {