- colors: add COL_PROGRESSBAR wrapper

This commit is contained in:
vanhofen
2016-10-10 14:19:55 +02:00
committed by svenhoefer
parent 3284484300
commit be40e67b70
7 changed files with 54 additions and 12 deletions

View File

@@ -59,7 +59,9 @@ void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, c
sb_scale_height = -1;
dy_font = CNeutrinoFonts::getInstance();
sb_caption_color= COL_INFOBAR_TEXT;
sb_caption_color= COL_MENUCONTENT_TEXT;
sb_active_color = COL_PROGRESSBAR_ACTIVE_PLUS_0;
sb_passive_color= COL_PROGRESSBAR_PASSIVE_PLUS_0;
sb_val_mode = CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT;
sb_lastsig = 0;
@@ -109,6 +111,8 @@ void CSignalBar::initSBItems()
//and set required color for text to name label
CSignalBox *sbx = static_cast<CSignalBox*>(cc_parent);
sb_caption_color = sbx->getTextColor();
sb_active_color = sbx->getActiveColor();
sb_passive_color = sbx->getPassiveColor();
}
//init items scale, value and name
@@ -127,11 +131,11 @@ void CSignalBar::initSBarScale()
int scale_y = (sb_item_height/2 - sb_scale_height/2);
sb_scale->setDimensionsAll(fr_thickness, scale_y, sb_scale_width, sb_scale_height);
sb_scale->setColorBody(col_body);
sb_scale->setActiveColor(sb_active_color);
sb_scale->setPassiveColor(sb_passive_color);
//add scale object to container
if(!sb_scale->isAdded())
addCCItem(sb_scale);
}
void CSignalBar::initSBarValue()
@@ -182,7 +186,6 @@ void CSignalBar::initSBarName()
sb_lbl->setTextColor(sb_caption_color);
sb_lbl->setColorBody(col_body);
//add name label object to container
if (!sb_lbl->isAdded())
addCCItem(sb_lbl);
@@ -295,7 +298,9 @@ void CSignalBox::initVarSigBox()
height = 3* SB_MIN_HEIGHT;
sbx_bar_height = height/2;
sbx_bar_x = corner_rad;
sbx_caption_color = COL_INFOBAR_TEXT;
sbx_caption_color = COL_MENUCONTENT_TEXT;
sbx_active_color = COL_PROGRESSBAR_ACTIVE_PLUS_0;
sbx_passive_color = COL_PROGRESSBAR_PASSIVE_PLUS_0;
vertical = true;
}
@@ -316,12 +321,18 @@ void CSignalBox::initSignalItems()
sbar->setDimensionsAll(sbar_x, 1, sbar_w, sbar_h);
sbar->setFrontEnd(sbx_frontend);
sbar->setTextColor(sbx_caption_color);
sbar->setActiveColor(sbx_active_color);
sbar->setPassiveColor(sbx_passive_color);
sbar->setCorner(0);
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->setFrontEnd(sbx_frontend);
snrbar->setTextColor(sbx_caption_color);
snrbar->setActiveColor(sbx_active_color);
snrbar->setPassiveColor(sbx_passive_color);
snrbar->setCorner(0);
snrbar->setScaleHeight(scale_h);
snrbar->enableTboxSaveScreen(cc_txt_save_screen);

View File

@@ -69,6 +69,10 @@ class CSignalBar : public CComponentsForm, public CCTextScreen
CNeutrinoFonts *dy_font;
///property: text color, see also setTextColor()
fb_pixel_t sb_caption_color;
///property: active color, see also setActiveColor()
fb_pixel_t sb_active_color;
///property: passive color, see also setPassiveColor()
fb_pixel_t sb_passive_color;
///property: item top position
int sb_item_top;
@@ -121,6 +125,10 @@ class CSignalBar : public CComponentsForm, public CCTextScreen
virtual void setTextFont(Font* font_text){sb_font = font_text;};
///sets the caption color, see also property 'sb_caption_color'
virtual void setTextColor(const fb_pixel_t& caption_color){ sb_caption_color = caption_color;};
///set active color, see also property 'sb_active_color'
virtual void setActiveColor(const fb_pixel_t& active_color){ sb_active_color = active_color;};
///set passive color, see also property 'sb_passive_color'
virtual void setPassiveColor(const fb_pixel_t& passive_color){ sb_passive_color = passive_color;};
///assigns the height of scale
virtual void setScaleHeight(const int& scale_height){sb_scale_height = scale_height;};
///assigns the width of scale
@@ -277,6 +285,10 @@ class CSignalBox : public CComponentsForm, public CCTextScreen
int sbx_bar_x;
///property: text color, see also setTextColor()
fb_pixel_t sbx_caption_color;
///property: active color, see also setActiveColor()
fb_pixel_t sbx_active_color;
///property: passive color, see also setPassiveColor()
fb_pixel_t sbx_passive_color;
// true if vertical arrangement, false if horizontal
bool vertical;
@@ -306,6 +318,16 @@ class CSignalBox : public CComponentsForm, public CCTextScreen
///get caption color of signalbars, see also property 'sbx_caption_color'
fb_pixel_t getTextColor(){return sbx_caption_color;};
///set active color of signalbars, see also property 'sbx_active_color'
void setActiveColor(const fb_pixel_t& active_color){ sbx_active_color = active_color;};
///get active color of signalbars, see also property 'sbx_active_color'
fb_pixel_t getActiveColor(){return sbx_active_color;};
///set passive color of signalbars, see also property 'sbx_passive_color'
void setPassiveColor(const fb_pixel_t& passive_color){ sbx_passive_color = passive_color;};
///get passive color of signalbars, see also property 'sbx_passive_color'
fb_pixel_t getPassiveColor(){return sbx_passive_color;};
///paint items
void paint(bool do_save_bg);

View File

@@ -101,8 +101,8 @@ class CProgressBar : public CComponentsItem
fb_pixel_t color_frame = 0,
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
const fb_pixel_t active_col = COL_INFOBAR_PLUS_7,
const fb_pixel_t passive_col = COL_INFOBAR_PLUS_3,
const fb_pixel_t active_col = COL_PROGRESSBAR_ACTIVE_PLUS_0,
const fb_pixel_t passive_col = COL_PROGRESSBAR_PASSIVE_PLUS_0,
const int R = 40,
const int G = 100,
const int Y = 70,