Merge branch 'master' into pu/mp

This commit is contained in:
Jacek Jendrzej
2017-05-28 22:30:05 +02:00
16 changed files with 68 additions and 64 deletions

View File

@@ -374,15 +374,16 @@ bool CCDraw::clearFbGradientData()
for(size_t i =0; i< v_fbdata.size() ;i++) {
if (v_fbdata[i].gradient_data){
if (v_fbdata[i].gradient_data->gradientBuf){
dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->gradientBuf);
free(v_fbdata[i].gradient_data->gradientBuf);
v_fbdata[i].gradient_data->gradientBuf = NULL;
dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf...\033[0m\n", __func__, __LINE__);
}
if (v_fbdata[i].gradient_data->boxBuf){
dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->boxBuf);
cs_free_uncached(v_fbdata[i].gradient_data->boxBuf);
v_fbdata[i].gradient_data->boxBuf = NULL;
dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf...\033[0m\n", __func__, __LINE__);
}
dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradient data \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data);
delete v_fbdata[i].gradient_data;
v_fbdata[i].gradient_data = NULL;
ret = true;

View File

@@ -157,7 +157,7 @@ class CComponentsForm : public CComponentsItem
///select a definied item, parameter1 as size_t
virtual void setSelectedItem( int item_id,
const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0,
const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0,
const fb_pixel_t& frame_col = COL_FRAME_PLUS_0,
const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0,
const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0,
const int& frame_w = 3,
@@ -165,7 +165,7 @@ class CComponentsForm : public CComponentsItem
///select a definied item, parameter1 as CComponentsItem*
virtual void setSelectedItem( CComponentsItem* cc_item,
const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0,
const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0,
const fb_pixel_t& frame_col = COL_FRAME_PLUS_0,
const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0,
const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0,
const int& frame_w = 3,

View File

@@ -106,13 +106,13 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const
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);
col_frame = color_frame;
col_body = cc_body_gradient_enable? COL_DARK_GRAY : color_body;
col_body = col_body_old = cc_body_gradient_enable? COL_DARK_GRAY : color_body;
col_shadow = color_shadow;
cc_item_enabled = enabled;
cc_item_selected = selected;
fr_thickness = 0; //TODO: parts of the GUI still don't use framed buttons
append_x_offset = 6;
append_x_offset = OFFSET_INTER;
append_y_offset = 0;
corner_rad = RADIUS_SMALL;
@@ -187,6 +187,7 @@ void CComponentsButton::initCaption()
}
//set basic properties
int x_offset = (!cc_btn_text_obj || !cc_btn_icon_obj) ? 0 : append_x_offset;
int w_frame = fr_thickness;
int reduce = 2*w_frame;
if (cc_btn_text_obj){
@@ -198,7 +199,7 @@ void CComponentsButton::initCaption()
if (cc_btn_font == NULL)
cc_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT];
int w_cap = min(width - append_x_offset - x_cap - reduce, cc_btn_font->getRenderWidth(cc_btn_text));
int w_cap = min(width - x_offset - x_cap - reduce, cc_btn_font->getRenderWidth(cc_btn_text));
int h_cap = min(height - reduce, cc_btn_font->getHeight());
/*NOTE:
paint of centered text in y direction without y_offset
@@ -235,10 +236,10 @@ void CComponentsButton::initCaption()
}
//handle common position of icon and text inside container required for alignment
int w_required = w_frame + append_x_offset;
w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0;
int w_required = w_frame + x_offset;
w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + x_offset : 0;
w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_text) : 0;
w_required += append_x_offset + w_frame;
w_required += x_offset + w_frame;
//dynamic width
if (w_required > width){
@@ -247,10 +248,10 @@ void CComponentsButton::initCaption()
}
//do center
int x_icon = width/2 - w_required/2 /*+ fr_thickness + append_x_offset*/;
int x_icon = width/2 - w_required/2 /*+ fr_thickness + x_offset*/;
int w_icon = 0;
if (cc_btn_icon_obj){
x_icon += w_frame + append_x_offset;
x_icon += w_frame + x_offset;
cc_btn_icon_obj->setXPos(x_icon);
w_icon = cc_btn_icon_obj->getWidth();
/*in case of dynamic changed height of caption or button opbject itself,
@@ -260,7 +261,7 @@ void CComponentsButton::initCaption()
cc_btn_icon_obj->setYPos(y_icon);
}
if (cc_btn_text_obj){
cc_btn_text_obj->setXPos(x_icon + w_icon + append_x_offset);
cc_btn_text_obj->setXPos(x_icon + w_icon + x_offset);
cc_btn_text_obj->setWidth(width - cc_btn_text_obj->getXPos());
}
}

View File

@@ -103,7 +103,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
const neutrino_locale_t& caption_locale,
@@ -112,7 +112,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
const neutrino_locale_t& caption_locale,
@@ -121,7 +121,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
const std::string& caption,
@@ -130,7 +130,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///set text color
void setButtonTextColor(fb_pixel_t caption_color){cc_btn_text_col = caption_color;};
@@ -246,7 +246,7 @@ class CComponentsButtonRed : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_RED;
@@ -257,7 +257,7 @@ class CComponentsButtonRed : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_RED;
@@ -277,7 +277,7 @@ class CComponentsButtonGreen : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_GREEN;
@@ -289,7 +289,7 @@ class CComponentsButtonGreen : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_GREEN;
@@ -309,7 +309,7 @@ class CComponentsButtonYellow : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW;
@@ -320,7 +320,7 @@ class CComponentsButtonYellow : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW;
@@ -340,7 +340,7 @@ class CComponentsButtonBlue : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_BLUE;
@@ -351,7 +351,7 @@ class CComponentsButtonBlue : public CComponentsButton
bool selected = false,
bool enabled = true,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_BUTTON_BLUE;

View File

@@ -325,12 +325,14 @@ bool CComponentsFrmClock::startClock()
if (cl_timer == NULL){
cl_timer = new CComponentsTimer(0);
cl_timer->setThreadName("frmClock");
if (cl_timer->OnTimer.empty()){
dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__);
cl_timer->OnTimer.connect(cl_sl_show);
force_paint_bg = true;
}
}
if (cl_timer->OnTimer.empty()){
dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__);
cl_timer->OnTimer.connect(cl_sl_show);
force_paint_bg = true;
}
cl_timer->setTimerInterval(cl_interval);
if (cl_timer->startTimer())
@@ -390,7 +392,7 @@ void CComponentsFrmClock::paint(bool do_save_bg)
void CComponentsFrmClock::setClockFont(Font *font, const int& style)
{
if (cl_font != font || (cl_font != font)){
if (cl_font != font || cl_font_style != style){
if (cl_font != font)
cl_font = font;
if (style != -1)

View File

@@ -232,8 +232,10 @@ void CComponentsHeader::initIcon()
//init cch_icon_obj only if an icon available
if (cch_icon_name.empty()) {
cch_icon_w = 0;
if (cch_icon_obj)
if (cch_icon_obj){
removeCCItem(cch_icon_obj);
cch_icon_obj = NULL;
}
return;
}

View File

@@ -110,7 +110,7 @@ class CComponentsItem : public CComponents
///set select mode
virtual void setSelected(bool selected,
const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0,
const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0,
const fb_pixel_t& frame_col = COL_FRAME_PLUS_0,
const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0,
const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0,
const int& frame_w = 3,

View File

@@ -143,6 +143,7 @@ bool CComponentsTimer::startTimer()
bool CComponentsTimer::stopTimer()
{
tm_enable = false;
OnTimer.clear();
stopThread();
if(tm_thread == 0)
return true;