Colorsettings: add possibility to change shadow color

Shadow color was bound to infobar color and it's not really
understandable why, because with some colors eg. black, the shadow is
grey or with other colors it is exaggerated colored and seems to be
not realistically and looks unusual if shadow is brighter or colorful
than foreground. Some themes will thank it.

TODO: update theme files with matching values if required


Origin commit data
------------------
Commit: c600b4c416
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-08-02 (Wed, 02 Aug 2017)
This commit is contained in:
2017-08-02 08:59:56 +02:00
parent 552e7c8777
commit 22ed88a072
8 changed files with 35 additions and 3 deletions

View File

@@ -765,6 +765,8 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors)
&t.menu_Foot_alpha, colorSetupNotifier);
CColorChooser* chFootTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Foot_Text_red, &t.menu_Foot_Text_green, &t.menu_Foot_Text_blue,
NULL, colorSetupNotifier);
CColorChooser* chShadowColor = new CColorChooser(LOCALE_COLORMENU_SHADOW_COLOR, &t.shadow_red, &t.shadow_green, &t.shadow_blue,
&t.menu_Head_alpha, colorSetupNotifier);
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUHEAD));
@@ -930,6 +932,13 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors)
oj = new CMenuOptionChooser(LOCALE_MISCSETTINGS_COLORED_EVENTS_INFOBAR, &t.colored_events_infobar, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true);
oj->setHint("", LOCALE_MENU_HINT_COLORED_EVENTS);
menu_colors->addItem(oj);
// shadow
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE));
mf = new CMenuDForwarder(LOCALE_COLORMENU_SHADOW_COLOR, true, NULL, chShadowColor );
mf->setHint("", LOCALE_MENU_HINT_COLORS_SHADOW);
menu_colors->addItem(mf);
}
/* for font size setup */

View File

@@ -329,6 +329,11 @@ void CThemes::setTheme(CConfigFile &configfile)
configfile.setInt32( "progressbar_timescale_green", t.progressbar_timescale_green);
configfile.setInt32( "progressbar_timescale_yellow", t.progressbar_timescale_yellow);
configfile.setInt32( "progressbar_timescale_invert", t.progressbar_timescale_invert);
configfile.setInt32( "shadow_alpha", t.shadow_alpha );
configfile.setInt32( "shadow_red", t.shadow_red );
configfile.setInt32( "shadow_green", t.shadow_green );
configfile.setInt32( "shadow_blue", t.shadow_blue );
}
void CThemes::getTheme(CConfigFile &configfile)
@@ -428,6 +433,11 @@ void CThemes::getTheme(CConfigFile &configfile)
t.progressbar_timescale_green = configfile.getInt32("progressbar_timescale_green", 100);
t.progressbar_timescale_yellow = configfile.getInt32("progressbar_timescale_yellow", 70);
t.progressbar_timescale_invert = configfile.getInt32("progressbar_timescale_invert", 0);
t.shadow_alpha = configfile.getInt32( "shadow_alpha", 0 );
t.shadow_red = configfile.getInt32( "shadow_red", 8 );
t.shadow_green = configfile.getInt32( "shadow_green", 8);
t.shadow_blue = configfile.getInt32( "shadow_blue", 8 );
}
void CThemes::move_userDir()

View File

@@ -352,6 +352,7 @@ typedef enum
LOCALE_COLORMENU_MENUCOLORS,
LOCALE_COLORMENU_OSD_PRESET,
LOCALE_COLORMENU_OSD_RESOLUTION,
LOCALE_COLORMENU_SHADOW_COLOR,
LOCALE_COLORMENU_TEXTCOLOR,
LOCALE_COLORMENU_THEMESELECT,
LOCALE_COLORMENU_TIMING,
@@ -1063,6 +1064,7 @@ typedef enum
LOCALE_MENU_HINT_COLORED_EVENTS,
LOCALE_MENU_HINT_COLORED_EVENTS_TEXTCOLOR,
LOCALE_MENU_HINT_COLORS,
LOCALE_MENU_HINT_COLORS_SHADOW,
LOCALE_MENU_HINT_CONTENT_BACK,
LOCALE_MENU_HINT_CONTENT_TEXTCOLOR,
LOCALE_MENU_HINT_DBOXINFO,

View File

@@ -352,6 +352,7 @@ const char * locale_real_names[] =
"colormenu.menucolors",
"colormenu.osd_preset",
"colormenu.osd_resolution",
"colormenu.shadow_color",
"colormenu.textcolor",
"colormenu.themeselect",
"colormenu.timing",
@@ -1063,6 +1064,7 @@ const char * locale_real_names[] =
"menu.hint_colored_events",
"menu.hint_colored_events_textcolor",
"menu.hint_colors",
"menu.hint_colors_shadow",
"menu.hint_content_back",
"menu.hint_content_textcolor",
"menu.hint_dboxinfo",

View File

@@ -179,9 +179,9 @@ void CColorSetupNotifier::setPalette()
8, convertSetupAlpha2Alpha(t.infobar_alpha) );
frameBuffer->paletteGenFade(COL_SHADOW,
convertSetupColor2RGB(int(t.infobar_red*0.4), int(t.infobar_green*0.4), int(t.infobar_blue*0.4)),
convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue),
8, convertSetupAlpha2Alpha(t.infobar_alpha) );
convertSetupColor2RGB(int(t.shadow_red), int(t.shadow_green), int(t.shadow_blue)),
convertSetupColor2RGB(t.shadow_red, t.shadow_green, t.shadow_blue),
8, convertSetupAlpha2Alpha(t.shadow_alpha) );
frameBuffer->paletteGenFade(COL_INFOBAR_CASYSTEM,
convertSetupColor2RGB(t.infobar_casystem_red, t.infobar_casystem_green, t.infobar_casystem_blue),

View File

@@ -153,6 +153,11 @@ struct SNeutrinoTheme
int progressbar_timescale_green;
int progressbar_timescale_yellow;
int progressbar_timescale_invert;
unsigned char shadow_alpha;
unsigned char shadow_red;
unsigned char shadow_green;
unsigned char shadow_blue;
};
struct timer_remotebox_item