From 9ac706b86c875556da906305d3307e086dc84186 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:04:34 +0200 Subject: [PATCH 1/8] CComponentsForm: try to fix fit items inside forms Some items had offsets on screen. Was seen eg. in message windows. --- src/gui/components/cc_frm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index d124f3395..87cb5f66d 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -375,6 +375,7 @@ void CComponentsForm::paintCCItems() if (cc_parent){ this_x = auto_x = cc_xr; this_y = auto_y = cc_yr; + w_parent_frame = cc_parent->getFrameThickness(); } //init and handle scrollbar @@ -482,7 +483,7 @@ void CComponentsForm::paintCCItems() //Is it too wide or too high, it will be shortened and displayed in the log. //This should be avoid! //checkwidth and adapt if required - int right_frm = (cc_parent ? cc_xr : x) + this_w - 2*fr_thickness; + int right_frm = (cc_parent ? cc_xr : x) + this_w/* - 2*fr_thickness*/; int right_item = cc_item->getRealXPos() + w_item; int w_diff = right_item - right_frm; int new_w = w_item - w_diff; From e1f51050b213c823919b6ad40773e4d7ce3ca94f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:07:56 +0200 Subject: [PATCH 2/8] CComponentsWindow: try to fix header and footer arrangement Header and footer were placed too much on left side. --- src/gui/components/cc_frm_window.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 80455a5ad..acf06e1b4 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -201,7 +201,7 @@ void CComponentsWindow::initHeader() //set header properties //TODO: assigned properties with internal header objekt have no effect! if (ccw_head){ ccw_head->setWidth(width-2*fr_thickness); - ccw_head->setPos(0, 0); + ccw_head->setPos(fr_thickness, fr_thickness); ccw_head->setIcon(ccw_icon_name); ccw_head->setCaption(ccw_caption, ccw_align_mode, ccw_col_head_text); ccw_head->setContextButton(ccw_buttons); @@ -219,8 +219,8 @@ void CComponentsWindow::initFooter() if (ccw_footer){ if (ccw_h_footer) ccw_footer->setHeight(ccw_h_footer); - ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()- fr_thickness); - ccw_footer->setWidth(width-2*fr_thickness); + ccw_footer->setPos(cc_xr + fr_thickness, cc_yr + height - ccw_footer->getHeight()- fr_thickness); + ccw_footer->setWidth(width/*-2*fr_thickness*/); ccw_footer->enableShadow(false/*shadow*/); ccw_footer->setCorner(corner_rad-fr_thickness, CORNER_BOTTOM); ccw_footer->setButtonFont(ccw_button_font); From 42db55e61de803e8dc610e754ded097e8d31b02a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 15:51:54 +0200 Subject: [PATCH 3/8] CComponentsHeader: Reduce offset between clock and right border. Was too large --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index acdee9363..351b6cc3e 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -475,7 +475,7 @@ void CComponentsHeader::initCaption() int clock_w = cch_cl_enable ? cch_cl_obj->getWidth() : 0; //set x position of clock - cch_cl_obj->setXPos(width - buttons_w - clock_w - cch_offset); + cch_cl_obj->setXPos(width - buttons_w - clock_w); //set required width of caption object cc_text_w -= (clock_w + cch_offset); From cbba7b78f46ded09a80940579cc203dbeeb3ee96 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:36:02 +0200 Subject: [PATCH 4/8] CComponentsFrmClock: remove unnecessary call of cch_cl_obj->setYPos() --- src/gui/components/cc_frm_header.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 351b6cc3e..f8a1038cd 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -413,7 +413,6 @@ void CComponentsHeader::initClock() //set clock form properties if (cch_cl_obj){ - cch_cl_obj->setYPos(cch_items_y); cch_cl_obj->setHeight(height); //disallow paint of clock, if disabled and exit method From 04f9468ddb4eca0c3b8b2787d9016b06554638af Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:42:24 +0200 Subject: [PATCH 5/8] CComponentsFrmClock: use correct setHeight() --- src/gui/components/cc_frm_clock.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index f11a27f18..297406e9f 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -59,8 +59,8 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, { cc_item_type = CC_ITEMTYPE_FRM_CLOCK; - x = x_pos; - y = y_pos; + x = cc_xr = x_old = x_pos; + y = cc_yr = y_old = y_pos; shadow = shadow_mode; shadow_w = OFFSET_SHADOW; @@ -84,8 +84,8 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, initClockFont(0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); //init general clock dimensions - height = cl_font->getHeight(); - width = cl_font->getRenderWidth(cl_format_str); + height = height_old= cl_font->getHeight(); + width = width_old = cl_font->getRenderWidth(cl_format_str); //set default text background behavior cc_txt_save_screen = false; @@ -429,9 +429,9 @@ void CComponentsFrmClock::setHeight(const int& h) int f_height = cl_font->getHeight(); if (h != f_height){ dprintf(DEBUG_DEBUG, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); - CCDraw::setHeight(f_height); + CComponentsItem::setHeight(f_height); }else - CCDraw::setHeight(h); + CComponentsItem::setHeight(h); initCCLockItems(); } @@ -443,9 +443,9 @@ void CComponentsFrmClock::setWidth(const int& w) int f_width = cl_font->getRenderWidth(cl_format_str); if (w != f_width){ dprintf(DEBUG_NORMAL, "\033[33m[CComponentsFrmClock]\t[%s - %d], font width is different than current width [%d], using [%d] ...\033[0m\n", __func__, __LINE__, w, f_width); - CCDraw::setWidth(f_width); + CComponentsItem::setWidth(f_width); }else - CCDraw::setWidth(w); + CComponentsItem::setWidth(w); initCCLockItems(); } From b8822803d9d59a95b8d54dbb10108ee623af61c3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 16:56:42 +0200 Subject: [PATCH 6/8] CSignalBar: use global offsets for init of min height --- src/gui/components/cc_frm_signalbars.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 018ad066f..6ffd03c40 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -34,7 +34,7 @@ #include #include -#define SB_MIN_HEIGHT 12 +#define SB_MIN_HEIGHT OFFSET_INNER_MID #define REF_PERCENT_TXT "100% " using namespace std; @@ -55,8 +55,8 @@ void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, c corner_rad = 0; corner_type = 0; - append_x_offset = 2; - append_y_offset = 2; + append_x_offset = OFFSET_INNER_MIN; + append_y_offset = OFFSET_INNER_MIN; sb_scale_height = -1; dy_font = CNeutrinoFonts::getInstance(); From 0e94c6830b25e91337e560eeacf82176af157881 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 17:00:48 +0200 Subject: [PATCH 7/8] CComponentsForm: use global default width for scrollbar --- 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 87cb5f66d..c202c6742 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -68,7 +68,7 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w, page_count = 1; cur_page = 0; sb = NULL; - w_sb = 15; + w_sb = SCROLLBAR_WIDTH; page_scroll_mode = PG_SCROLL_M_UP_DOWN_KEY; From f74724ceb655b6f04a7b029ab58fa526423bbfd6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Apr 2017 17:41:34 +0200 Subject: [PATCH 8/8] CSignalBox: remove CC_APPEND flag Should be gradually removed in all affected classes --- src/gui/components/cc_frm_signalbars.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 6ffd03c40..1ef19cbd4 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -330,7 +330,7 @@ void CSignalBox::initSignalItems() sbar->setScaleHeight(scale_h); sbar->enableTboxSaveScreen(cc_txt_save_screen); - snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h); + snrbar->setDimensionsAll(vertical ? sbar_x : sbar->getXPos() + sbar->getWidth() + append_x_offset, vertical ? sbar->getYPos() + sbar->getHeight() + append_y_offset : 1, sbar_w, sbar_h); snrbar->setFrontEnd(sbx_frontend); snrbar->setTextColor(sbx_caption_color); snrbar->setActiveColor(sbx_active_color);