From 5ab0fbc0817280750072be0268d787558a431f8a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:10:29 +0100 Subject: [PATCH 1/7] settings.h: enable scale for DETAILSLINE_WIDTH Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/afe98d395210f4263125a40a783deb5651302499 Author: Thilo Graf Date: 2017-03-14 (Tue, 14 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/settings.h b/src/system/settings.h index 70280a589..945c13ecc 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -930,7 +930,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH OFFSET_INNER_MID + 2*OFFSET_INNER_MIN -#define DETAILSLINE_WIDTH 16 // TODO: scale2Res() ? +#define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) struct SglobalInfo { From 20c5788556f3170c39cba3247cb7c8d59f2333d3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:11:45 +0100 Subject: [PATCH 2/7] cc_types.h: add scale to CC_WIDTH_MIN/CC_HEIGHT_MIN Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/df484340927dae179ed3e21a10be2dec98d2d0d0 Author: Thilo Graf Date: 2017-03-14 (Tue, 14 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 5f56ee181..7b57dc9e3 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -191,8 +191,8 @@ typedef struct button_label_cc button_label_cc(): button(NULL), text(std::string()), locale(NONEXISTANT_LOCALE){} } button_label_cc_struct; -#define CC_WIDTH_MIN 16 -#define CC_HEIGHT_MIN 16 +#define CC_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(16) +#define CC_HEIGHT_MIN CC_WIDTH_MIN #define CC_SHADOW_OFF 0x0 #define CC_SHADOW_RIGHT 0x2 From 19c6ff581a78823537c3ede472eed47cd48195ac Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 14 Mar 2017 09:23:31 +0100 Subject: [PATCH 3/7] CComponentsDetailsLine: add scale to details line width Also added correction for odd line width values and added method to change details line width. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f5f2bf92bad20d532dbb95368dd52da54db53447 Author: Thilo Graf Date: 2017-03-14 (Tue, 14 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_detailsline.cpp | 23 ++++++++++++----------- src/gui/components/cc_detailsline.h | 6 ++++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index 81da16c5e..82dd27cca 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -61,7 +61,7 @@ void CComponentsDetailsLine::initVarDline( const int& x_pos, const int& y_pos_to shadow_w = 1; //CComponentsDetailsLine - thickness = 4; /* MUST be an even value! */ + dl_w = CFrameBuffer::getInstance()->scale2Res(3); cc_body_gradient_enable = false; } @@ -101,6 +101,7 @@ void CComponentsDetailsLine::paint(bool do_save_bg) int y_mark_top = y-h_mark_top/2; int y_mark_down = y_down-h_mark_down/2; + int dx_c = dl_w%2; //correction for odd values cc_fbdata_t fbdata[] = { @@ -108,26 +109,26 @@ void CComponentsDetailsLine::paint(bool do_save_bg) {true, CC_FBDATA_TYPE_BGSCREEN, x, y_mark_top, width, y_mark_down-y_mark_top+h_mark_down+sw, 0, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical item mark | */ - {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_top, thickness, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_top, dl_w, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false}, {true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_top+sw, sw, h_mark_top-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_top+h_mark_top, dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal item line - */ - {true, CC_FBDATA_TYPE_BOX, x, y-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, width-2*dl_w-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical connect line [ */ - {true, CC_FBDATA_TYPE_BOX, x, y+thickness/2, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y+dl_w/2+dx_c, dl_w, y_down-y-dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, sw, y_down-y-dl_w, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal info line - */ - {true, CC_FBDATA_TYPE_BOX, x, y_down-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness/2, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y_down-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+dl_w/2+dx_c, width-dl_w-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical info mark | */ - {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_down, dl_w, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, {true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_down+sw, sw, h_mark_down-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_down+h_mark_down,thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_down+h_mark_down,dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, }; for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) diff --git a/src/gui/components/cc_detailsline.h b/src/gui/components/cc_detailsline.h index be07ef57f..66197f51f 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -40,8 +40,8 @@ Not usable as CCItem! class CComponentsDetailsLine : public CComponents { private: - ///property: line thickness - int thickness; + ///property: line width + int dl_w; ///property: lowest y position int y_down; ///property: height of top marker @@ -73,6 +73,8 @@ class CComponentsDetailsLine : public CComponents ///set all positions and dimensions of details line at once void setDimensionsAll(const int& x_pos,const int& y_pos, const int& y_pos_down, const int& h_mark_top_ , const int& h_mark_down_) {setXPos(x_pos); setYPos(y_pos); setYPosDown(y_pos_down); setHMarkTop(h_mark_top_); setHMarkDown(h_mark_down_);} + ///property: set line thickness + void setLineWidth(const int& w){dl_w = w;} ///paint all to screen void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); From 46859665edb06310f0e1575d877e225cde1684bb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:17:16 +0100 Subject: [PATCH 4/7] CImageInfo: use global offset for item offset Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1db1182b87be39b69b57d54bc99b0d620bb64f3f Author: Thilo Graf Date: 2017-03-15 (Wed, 15 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 8dd342ed8..dd0e8a1c1 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -69,7 +69,7 @@ void CImageInfo::Init(void) cc_sub_caption = NULL; b_info = NULL; btn_red = NULL; - item_offset = 10; + item_offset = OFFSET_INNER_MID; item_font = NULL; item_height = 0; y_tmp = 0; From 344b254a4b7c602dda4ba0453a3714c0988eff5b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:37:55 +0100 Subject: [PATCH 5/7] CComponentsExtTextForm: fix label width calculation Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/81cde4836fc6b04129560f2b4847eb95e3e89b3d Author: Thilo Graf Date: 2017-03-15 (Wed, 15 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_ext_text.cpp | 6 +++--- src/gui/components/cc_frm_ext_text.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 864336d91..7ae619423 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -86,8 +86,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p width = w; //init ccx_label_width and ccx_text_width //default ccx_label_width = 30% of form width - ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT; - ccx_label_width = ccx_percent_label_w * width/100; + ccx_label_width = DEF_LABEL_WIDTH_PERCENT * width/100; ccx_text_width = width-ccx_label_width; height = h; @@ -223,7 +222,8 @@ void CComponentsExtTextForm::initCCTextItems() void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) { - ccx_percent_label_w = (int)percent_val; + ccx_label_width = (int)percent_val * width/100; + ccx_text_width = width-ccx_label_width; initCCTextItems(); } diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 837eb8c18..4e37efd0f 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -49,8 +49,6 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen int ccx_text_width; ///property: font type of both items (label and text), see also setLabelAndText() Font* ccx_font; - ///property: percentage val of label width related to full width, causes fit of text automatically into the available remaining size of item, see also setLabelWidthPercent() - uint8_t ccx_percent_label_w; ///centered y position of label and text int y_text; From e05016388d1b71e03f44e5275b2077e19701ff14 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:41:03 +0100 Subject: [PATCH 6/7] CImageInfo: optimize label arrangement Distance between label and text was too large with full hd resolution. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17227504c29ec48d6f96411aa1d049c579e658e2 Author: Thilo Graf Date: 2017-03-15 (Wed, 15 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index dd0e8a1c1..d62fa7487 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -355,7 +355,7 @@ void CImageInfo::InitInfos() y_tmp = 0; for (size_t i=0; igetWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); - item->setLabelWidthPercent(20); + item->setLabelWidthPercent(15); if (!item_font){ item_font = item->getFont(); From 540c433a4158846c744c3ca8e98e39a7c53834cd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Mar 2017 09:47:00 +0100 Subject: [PATCH 7/7] CComponentsExtTextForm: use scaled default dimension values Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e498cc6b09b5521590db732c3296d91b4b78ff67 Author: Thilo Graf Date: 2017-03-15 (Wed, 15 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_ext_text.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 7ae619423..0587d90db 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -31,7 +31,8 @@ #include -#define DEF_HEIGHT 27 +#define DEF_HEIGHT CFrameBuffer::getInstance()->scale2Res(27) +#define DEF_WIDTH CFrameBuffer::getInstance()->scale2Res(300) #define DEF_LABEL_WIDTH_PERCENT 30 using namespace std; @@ -39,7 +40,7 @@ using namespace std; CComponentsExtTextForm::CComponentsExtTextForm(CComponentsForm* parent) { Font* t_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; - initVarExtTextForm(0, 0, 300, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); + initVarExtTextForm(0, 0, DEF_WIDTH, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); initCCTextItems(); }