From b778facb6a506b7fb2bc70bace1e39abb7d0f9f5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 17 May 2016 15:42:03 +0200 Subject: [PATCH] CComponentsWindow: use only body as background Should provide more performance Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/775e5c73a4eee0bc9864291bdfe1d18370bbdc70 Author: Thilo Graf Date: 2016-05-17 (Tue, 17 May 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 34 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index e3481ac93..388f7f6ac 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -215,12 +215,13 @@ void CComponentsWindow::initFooter() //add of footer item happens initCCWItems() //set footer properties if (ccw_footer){ - ccw_footer->setPos(0, CC_APPEND); + ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()/*- fr_thickness*/); ccw_footer->setWidth(width-2*fr_thickness); - ccw_footer->enableShadow(shadow); - ccw_footer->setCorner(corner_rad, CORNER_BOTTOM); + ccw_footer->enableShadow(false/*shadow*/); + ccw_footer->setCorner(corner_rad-fr_thickness/2, CORNER_BOTTOM); ccw_footer->setButtonFont(ccw_button_font); ccw_footer->setColorBody(ccw_col_footer); + ccw_footer->doPaintBg(true); } } @@ -240,7 +241,7 @@ void CComponentsWindow::initLeftSideBar() int h_sbar = height - h_header - h_footer - 2*fr_thickness; int w_sbar = ccw_w_sidebar; ccw_left_sidebar->setDimensionsAll(0, CC_APPEND, w_sbar, h_sbar); - ccw_left_sidebar->doPaintBg(false); + ccw_left_sidebar->doPaintBg(true); } } @@ -260,7 +261,7 @@ void CComponentsWindow::initRightSideBar() int h_sbar = height - h_header - h_footer - 2*fr_thickness; int w_sbar = ccw_w_sidebar; ccw_right_sidebar->setDimensionsAll(width - w_sbar, CC_APPEND, w_sbar, h_sbar); - ccw_right_sidebar->doPaintBg(false); + ccw_right_sidebar->doPaintBg(true); } } @@ -271,25 +272,36 @@ void CComponentsWindow::initBody() //add of body item happens initCCWItems() //set body properties if (ccw_body){ - ccw_body->setCornerType(0); + ccw_body->setCorner(corner_rad-fr_thickness/2, CORNER_NONE); int h_footer = 0; int h_header = 0; int w_l_sidebar = 0; int w_r_sidebar = 0; - if (ccw_footer) + if (ccw_footer){ h_footer = ccw_footer->getHeight(); - if (ccw_head) + } + if (ccw_head){ h_header = ccw_head->getHeight(); + } if (ccw_left_sidebar) w_l_sidebar = ccw_left_sidebar->getWidth(); if (ccw_right_sidebar) w_r_sidebar = ccw_right_sidebar->getWidth(); - int h_body = height - h_header - h_footer - 2*fr_thickness; + int h_body = height - h_header - h_footer/* - 2*fr_thickness*/; int x_body = w_l_sidebar; int w_body = width-2*fr_thickness - w_l_sidebar - w_r_sidebar; - ccw_body->setDimensionsAll(x_body, CC_APPEND, w_body, h_body); - ccw_body->doPaintBg(false); + ccw_body->setDimensionsAll(x_body, h_header, w_body, h_body); + ccw_body->doPaintBg(true); + + //handle corner behavior + if (!ccw_show_header) + ccw_body->setCornerType(CORNER_TOP); + if (!ccw_show_footer) + ccw_body->setCornerType(ccw_body->getCornerType() | CORNER_BOTTOM); + if (!ccw_show_header) + ccw_body->setCornerType(CORNER_TOP); + } }