CComponentsWindow: use only body as background

Should provide more performance


Origin commit data
------------------
Commit: 775e5c73a4
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-05-17 (Tue, 17 May 2016)
This commit is contained in:
2016-05-17 15:42:03 +02:00
parent 67e645be25
commit de5cef653c

View File

@@ -215,12 +215,13 @@ void CComponentsWindow::initFooter()
//add of footer item happens initCCWItems() //add of footer item happens initCCWItems()
//set footer properties //set footer properties
if (ccw_footer){ 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->setWidth(width-2*fr_thickness);
ccw_footer->enableShadow(shadow); ccw_footer->enableShadow(false/*shadow*/);
ccw_footer->setCorner(corner_rad, CORNER_BOTTOM); ccw_footer->setCorner(corner_rad-fr_thickness/2, CORNER_BOTTOM);
ccw_footer->setButtonFont(ccw_button_font); ccw_footer->setButtonFont(ccw_button_font);
ccw_footer->setColorBody(ccw_col_footer); 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 h_sbar = height - h_header - h_footer - 2*fr_thickness;
int w_sbar = ccw_w_sidebar; int w_sbar = ccw_w_sidebar;
ccw_left_sidebar->setDimensionsAll(0, CC_APPEND, w_sbar, h_sbar); 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 h_sbar = height - h_header - h_footer - 2*fr_thickness;
int w_sbar = ccw_w_sidebar; int w_sbar = ccw_w_sidebar;
ccw_right_sidebar->setDimensionsAll(width - w_sbar, CC_APPEND, w_sbar, h_sbar); 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() //add of body item happens initCCWItems()
//set body properties //set body properties
if (ccw_body){ if (ccw_body){
ccw_body->setCornerType(0); ccw_body->setCorner(corner_rad-fr_thickness/2, CORNER_NONE);
int h_footer = 0; int h_footer = 0;
int h_header = 0; int h_header = 0;
int w_l_sidebar = 0; int w_l_sidebar = 0;
int w_r_sidebar = 0; int w_r_sidebar = 0;
if (ccw_footer) if (ccw_footer){
h_footer = ccw_footer->getHeight(); h_footer = ccw_footer->getHeight();
if (ccw_head) }
if (ccw_head){
h_header = ccw_head->getHeight(); h_header = ccw_head->getHeight();
}
if (ccw_left_sidebar) if (ccw_left_sidebar)
w_l_sidebar = ccw_left_sidebar->getWidth(); w_l_sidebar = ccw_left_sidebar->getWidth();
if (ccw_right_sidebar) if (ccw_right_sidebar)
w_r_sidebar = ccw_right_sidebar->getWidth(); 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 x_body = w_l_sidebar;
int w_body = width-2*fr_thickness - w_l_sidebar - w_r_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->setDimensionsAll(x_body, h_header, w_body, h_body);
ccw_body->doPaintBg(false); 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);
} }
} }