diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 5f83b0826..b4a97f363 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -642,8 +642,10 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) CColorChooser* chHeadcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Head_red, &t.menu_Head_green, &t.menu_Head_blue, &t.menu_Head_alpha, colorSetupNotifier); + chHeadcolor->setGradient(CColorChooser::gradient_head_body); CColorChooser* chHeadTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Head_Text_red, &t.menu_Head_Text_green, &t.menu_Head_Text_blue, NULL, colorSetupNotifier); + chHeadTextcolor->setGradient(CColorChooser::gradient_head_text); CColorChooser* chContentcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Content_red, &t.menu_Content_green, &t.menu_Content_blue, &t.menu_Content_alpha, colorSetupNotifier); CColorChooser* chContentTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Content_Text_red, &t.menu_Content_Text_green, &t.menu_Content_Text_blue, diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 7ba47384e..8f758dc45 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -95,11 +95,28 @@ CColorChooser::CColorChooser(const neutrino_locale_t Name, unsigned char *R, uns value[VALUE_G] = G; value[VALUE_B] = B; value[VALUE_ALPHA] = Alpha; + + chooser_gradient = gradient_none; } void CColorChooser::setColor() { - frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, getColor()); + fb_pixel_t col = getColor(); + int x_col = x+offset+160; + int y_col = y+hheight+5; + int w_col = mheight*4; + int h_col = mheight*4-10; + + if ((g_settings.gradiant) && ((chooser_gradient == gradient_head_body) || (chooser_gradient == gradient_head_text))) { + CComponentsHeader header(x_col, y_col+((h_col-hheight)/2), w_col, hheight, "Head"); + if (chooser_gradient == gradient_head_body) + header.setColorBody(col); + else if (chooser_gradient == gradient_head_text) + header.setCaptionColor(col); + header.paint(CC_SAVE_SCREEN_NO); + } + else + frameBuffer->paintBoxRel(x_col+2, y_col+2, w_col-4 , h_col-4, col); } fb_pixel_t CColorChooser::getColor() @@ -253,9 +270,11 @@ void CColorChooser::paint() for (int i = 0; i < 4; i++) paintSlider(x + 10, y + hheight + mheight * i, value[i], colorchooser_names[i], iconnames[i], (i == 0)); - //color preview - frameBuffer->paintBoxRel(x+offset+160,y+hheight+5, mheight*4, mheight*4-10, COL_MENUHEAD_PLUS_0); - frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, 254); + if ((!g_settings.gradiant) || ((chooser_gradient != gradient_head_body) && (chooser_gradient != gradient_head_text))) { + //color preview + frameBuffer->paintBoxRel(x+offset+160,y+hheight+5, mheight*4, mheight*4-10, COL_MENUHEAD_PLUS_0); + frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, 254); + } } void CColorChooser::paintSlider(int px, int py, unsigned char *spos, const neutrino_locale_t text, const char * const iconname, const bool selected) diff --git a/src/gui/widget/colorchooser.h b/src/gui/widget/colorchooser.h index f2ff70c90..5ecc64ec6 100644 --- a/src/gui/widget/colorchooser.h +++ b/src/gui/widget/colorchooser.h @@ -50,6 +50,7 @@ class CColorChooser : public CMenuTarget int hheight,mheight; // head/menu font height int offset; int font_info; + int chooser_gradient; unsigned char * value[4]; // r, g, b, alpha @@ -68,7 +69,13 @@ class CColorChooser : public CMenuTarget void hide(); int exec(CMenuTarget* parent, const std::string & actionKey); fb_pixel_t getColor(void); - + enum + { + gradient_none, + gradient_head_body, + gradient_head_text + }; + void setGradient(int gradient = gradient_none) { chooser_gradient = gradient; }; };