From c600b4c416b0fc409ff70e7d6a3898ae89a97bfa Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH] 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 --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/osd_setup.cpp | 9 +++++++++ src/gui/themes.cpp | 10 ++++++++++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/setting_helpers.cpp | 6 +++--- src/system/settings.h | 5 +++++ 8 files changed, 35 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 6aaf0e4eb..1319f74a8 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -325,6 +325,7 @@ colormenu.font_ttx Teletext Schriftart colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl colormenu.osd_resolution OSD-Auflösung +colormenu.shadow_color Schattenfarbe colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1036,6 +1037,7 @@ menu.hint_color_gradient_separator_enable Farbverlauf für Menü-Trennlinien akt menu.hint_colored_events Definiert, ob die aktuelle oder nächste Sendung in einer anderen Farbe dargestellt werden soll menu.hint_colored_events_textcolor Ändern Sie die Farbe für farbige Events in der Kanalliste und der Infobar menu.hint_colors Konfigurieren Sie die Menü-Farben +menu.hint_colors_shadow Einstellen der Schattenfarbe menu.hint_content_back Ändern Sie die Hintergrundfarbe für den Fensterinhalt menu.hint_content_textcolor Ändern Sie die Textfarbe für den Fensterinhalt menu.hint_dboxinfo Informationen über CPU und Arbeitsspeicher der Box diff --git a/data/locale/english.locale b/data/locale/english.locale index cc4e86104..7ff88c04a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -325,6 +325,7 @@ colormenu.font_ttx Select Teletext font colormenu.menucolors Colors colormenu.osd_preset TV preset colormenu.osd_resolution OSD resolution +colormenu.shadow_color Shadow Color colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1036,6 +1037,7 @@ menu.hint_color_gradient_separator_enable Disable/enable color gradient for menu menu.hint_colored_events Use different color for current or next event menu.hint_colored_events_textcolor Change color for colored events in channellist and infobar menu.hint_colors Configure GUI colors +menu.hint_colors_shadow Setup for shadow color. menu.hint_content_back Change GUI window background color menu.hint_content_textcolor Change GUI window text color menu.hint_dboxinfo Information about box cpu and storage diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 06122d93a..a56e0365a 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -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 */ diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 8e510b37a..70b202c6e 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -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() diff --git a/src/system/locals.h b/src/system/locals.h index f62dff5e9..9aee9e30b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ea6d87aac..bdd72cbfd 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -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", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index f53bce83e..2212b569f 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -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), diff --git a/src/system/settings.h b/src/system/settings.h index 9ca4e21d6..e344c2c71 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -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