Merge branch 'cst-next' into nmp-cst-next

Origin commit data
------------------
Commit: f5ad46c5d9
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-08-24 (Wed, 24 Aug 2016)
This commit is contained in:
Michael Liebmann
2016-08-24 09:54:34 +02:00
14 changed files with 213 additions and 26 deletions

View File

@@ -100,7 +100,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const
width = w;
height = h;
shadow = shadow_mode;
shadow_w = SHADOW_OFFSET;
shadow_w = SHADOW_OFFSET/2; //buttons are mostly small elements, so these elements should have a reasonable shadow width
cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient
setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light);
@@ -113,7 +113,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const
fr_thickness = 0; //TODO: parts of the GUI still don't use framed buttons
append_x_offset = 6;
append_y_offset = 0;
corner_rad = 0;
corner_rad = RADIUS_SMALL;
cc_btn_capt_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_MENUFOOT_TEXT;
cc_btn_capt_disable_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_DISABLED : COL_MENUCONTENTINACTIVE_TEXT;

View File

@@ -36,7 +36,7 @@ using namespace std;
CComponentsFooter::CComponentsFooter(CComponentsForm* parent)
{
//CComponentsFooter
initVarFooter(1, 1, 0, 0, 0, parent);
initVarFooter(1, 1, 0, 0, 0, parent, CC_SHADOW_OFF, COL_MENUCONTENT_PLUS_6, COL_MENUFOOT_PLUS_0, COL_SHADOW_PLUS_0);
}
CComponentsFooter::CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h,
@@ -117,7 +117,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont
//footer as primary container (in this context '=this') and the parent for the button label container (chain object),
//button label container (chain object) itself is concurrent the parent object for button objects.
if (chain == NULL){
chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this);
chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this, CC_SHADOW_OFF, COL_MENUCONTENT_PLUS_6, col_body);
chain->setCorner(this->corner_rad, this->corner_type);
chain->doPaintBg(false);
}

View File

@@ -60,13 +60,13 @@ Missing parameters are filled with default values and must be assigned afterward
class CComponentsFooter : public CComponentsHeader
{
private:
void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0,
const int& buttons = 0,
CComponentsForm *parent = NULL,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_body = COL_MENUFOOT_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h,
const int& buttons,
CComponentsForm *parent,
int shadow_mode,
fb_pixel_t color_frame,
fb_pixel_t color_body,
fb_pixel_t color_shadow );
///show button frame and background, default false
bool btn_contour;

View File

@@ -168,9 +168,10 @@ void CComponentsWindow::initWindowSize()
if (cc_parent)
return;
if (width == 0)
if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth())
width = frameBuffer->getScreenWidth();
if (height == 0)
if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight())
height = frameBuffer->getScreenHeight();
}
@@ -218,7 +219,7 @@ void CComponentsWindow::initFooter()
ccw_footer->setPos(0, 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/2, CORNER_BOTTOM);
ccw_footer->setCorner(corner_rad-fr_thickness, CORNER_BOTTOM);
ccw_footer->setButtonFont(ccw_button_font);
ccw_footer->setColorBody(ccw_col_footer);
ccw_footer->doPaintBg(true);