Fix black color corruption after scan; Change progressbar logic to follow progressbar_color setting, if bar created with blink enabled

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@333 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: e642e6f345
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-02-13 (Sat, 13 Feb 2010)
This commit is contained in:
[CST] Focus
2010-02-13 10:52:19 +00:00
parent f24bb85993
commit 71dd47a155
11 changed files with 38 additions and 29 deletions

View File

@@ -48,6 +48,7 @@ CProgressBar::CProgressBar(const bool bl, const int w, const int h,
width = w;
height = h;
last_width = -1;
bl_changed = g_settings.progressbar_color;
}
CProgressBar::~CProgressBar()
@@ -109,6 +110,10 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y,
const char *iconfile,
bool paintZero)
{
if(bl_changed != g_settings.progressbar_color) {
bl_changed = g_settings.progressbar_color;
reset();
}
// set colors
fb_pixel_t active_col = activebar_col != 0 ? activebar_col : COL_INFOBAR_PLUS_7;
fb_pixel_t passive_col = passivebar_col != 0 ? passivebar_col : COL_INFOBAR_PLUS_3;
@@ -118,7 +123,7 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y,
const int c_rad = 0;
/* if the bar is too small, do not draw the borders around it */
if (height / 2 <= frame_widht || blink || backgroundbar_col == 0)
if (height / 2 <= frame_widht || (blink && g_settings.progressbar_color) || backgroundbar_col == 0)
frame_widht = 0;
// get icon size
int icon_w = 0, icon_h = 0;
@@ -142,7 +147,7 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y,
// max height progressbar bar, if icon height larger than pb_height then get height from icon
int pb_max_height = icon_h > height ? icon_h + 2* frame_widht : height;
if (! blink)
if (!blink || !g_settings.progressbar_color)
{
// max height of active/passive bar
int bar_height = pb_max_height - 2*frame_widht;

View File

@@ -37,7 +37,7 @@ class CProgressBar
int frame_widht;
int last_width;
int red, green, yellow;
bool blink, invert;
bool blink, invert, bl_changed;
int width, height;
void realpaint(const int pos_x, const int pos_y,
const int value, const int max_value,
@@ -53,7 +53,7 @@ class CProgressBar
public:
/* parameters:
blinkenligts: true if you want colored progressbars. needed, no default.
blinkenligts: true if you want code to follow progressbar_color. needed, no default.
w, h: width / height of bar. Can later be set with paintProgressbar.
paintProgressBar2 can oly be used if w and h are set.
r, g, b: percentage of the bar where red/green/yellow is used.