themes: use hintbox and header gradient option in theme settings

Color gradient feature was originally intended for use
inside theme settings and it's not really suitable for
generally use as default in all themes at the moment, so it makes more
sense to have options in theme settings and let the user decide
to customize this, unless enough other gui parts can use this feature.


Origin commit data
------------------
Commit: 01516cf943
Author: Thilo Graf <dbt@novatux.de>
Date: 2015-04-29 (Wed, 29 Apr 2015)

Origin message was:
------------------
themes: use hintbox and header gradient option in theme settings

Color gradient feature was originally intended for use
inside theme settings and it's not really suitable for
generally use as default in all themes at the moment, so it makes more
sense to have options in theme settings and let the user decide
to customize this, unless enough other gui parts can use this feature.
This commit is contained in:
2015-04-29 10:16:55 +02:00
parent 67ce60084b
commit 6261b3b869
30 changed files with 68 additions and 22 deletions

View File

@@ -107,7 +107,7 @@ void CColorChooser::setColor()
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))) {
if ((g_settings.theme.menu_Head_gradient) && ((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);
@@ -270,7 +270,7 @@ 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));
if ((!g_settings.gradiant) || ((chooser_gradient != gradient_head_body) && (chooser_gradient != gradient_head_text))) {
if ((!g_settings.theme.menu_Head_gradient) || ((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);

View File

@@ -1303,7 +1303,7 @@ void CMenuWidget::paintHint(int pos)
if (pos < 0 && !hint_painted)
return;
info_box->enableGradient(g_settings.gradiant != 0); //TODO: manage via themes
info_box->enableGradient(g_settings.theme.menu_Hint_gradient != 0);
info_box->setColorBody(COL_MENUCONTENT_PLUS_0);
if (hint_painted) {
@@ -1826,6 +1826,7 @@ int CMenuOptionChooser::exec(CMenuTarget*)
}
}
paint(true);
OnAfterChangeOption();
if(observ && !luaAction.empty()) {
if (optionValname)
wantsRepaint = observ->changeNotify(luaState, luaAction, luaId, optionValname);

View File

@@ -355,7 +355,7 @@ struct CMenuOptionChooserCompareItem: public std::binary_function <const CMenuOp
};
};
class CMenuOptionChooser : public CAbstractMenuOptionChooser
class CMenuOptionChooser : public CAbstractMenuOptionChooser, public sigc::trackable
{
public:
struct keyval
@@ -430,7 +430,7 @@ class CMenuOptionChooser : public CAbstractMenuOptionChooser
int getWidth(void);
void setOptions(const struct keyval * const Options, const unsigned Number_Of_Options);
void setOptions(const struct keyval_ext * const Options, const unsigned Number_Of_Options);
sigc::signal<void> OnAfterChangeOption;
int paint(bool selected);
int exec(CMenuTarget* parent);