From b60daa3fd04229154fed73f3ae0942a6455a776e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Oct 2019 22:56:50 +0100 Subject: [PATCH] themes: add option to enable frames for message and hint boxes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e3f1754f1424ded1079ad03dfc6db03c5fd798d4 Author: Thilo Graf Date: 2019-10-27 (Sun, 27 Oct 2019) --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ data/themes/Bluemoon-3.0.theme | 1 + data/themes/Gray.theme | 1 + data/themes/Grey-Blue.theme | 1 + data/themes/Neutrino-3.0.theme | 1 + data/themes/Olive-3.0.theme | 1 + src/gui/osd_setup.cpp | 5 +++++ src/gui/themes.cpp | 6 ++++++ src/gui/widget/hintbox.cpp | 3 ++- src/gui/widget/msgbox.cpp | 3 ++- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 14 files changed, 29 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f58c9fda8..862b16dd9 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1788,6 +1788,8 @@ menu.hint_ytplay Wiedergabe von ausgewählten YouTube Feeds menu.hint_ytplay_setup Konfigurieren Sie YouTube-spezifische Optionen wie maximale Ergebnisse bei Suchen oder Cache-Verzeichnis menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann menu.next Weiter +message.frame_enable Rahmen für Meldungen und Hinweisfenster +message.frame_enable_hint Aktivieren von Rahmen für Meldungen und Hinweisfenster. messagebox.back Zurück messagebox.cancel Abbruch messagebox.discard Wollen Sie die Änderungen verwerfen? diff --git a/data/locale/english.locale b/data/locale/english.locale index cfd8a0a71..b8deffab2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1788,6 +1788,8 @@ menu.hint_ytplay Play selected YouTube feeds menu.hint_ytplay_setup Configure YouTube-specific options, e.g. an upper limit for search results menu.hint_zap_cycle When swithing channels, stay in current bouquet menu.next Next +message.frame_enable Message and hint box frames +message.frame_enable_hint Enable frames around message and hint boxes. messagebox.back Back messagebox.cancel Cancel messagebox.discard Discard changes? diff --git a/data/themes/Bluemoon-3.0.theme b/data/themes/Bluemoon-3.0.theme index 15269dbf5..471b7f93b 100644 --- a/data/themes/Bluemoon-3.0.theme +++ b/data/themes/Bluemoon-3.0.theme @@ -8,6 +8,7 @@ colored_events_channellist=1 colored_events_green=50 colored_events_infobar=2 colored_events_red=80 +message_frame_enable=1 infobar_Text_alpha=0 infobar_Text_blue=80 infobar_Text_green=80 diff --git a/data/themes/Gray.theme b/data/themes/Gray.theme index 97ea189ab..35a215eee 100644 --- a/data/themes/Gray.theme +++ b/data/themes/Gray.theme @@ -51,5 +51,6 @@ menu_Head_green=20 menu_Head_red=15 menu_Hint_gradient=0 menu_Head_gradient=0 +message_frame_enable=1 infobar_gradient_top=0 infobar_gradient_bottom=0 diff --git a/data/themes/Grey-Blue.theme b/data/themes/Grey-Blue.theme index 402295daa..eb9048de9 100644 --- a/data/themes/Grey-Blue.theme +++ b/data/themes/Grey-Blue.theme @@ -48,5 +48,6 @@ menu_Head_green=0 menu_Head_red=0 menu_Hint_gradient=0 menu_Head_gradient=0 +message_frame_enable=1 infobar_gradient_top=0 infobar_gradient_bottom=0 diff --git a/data/themes/Neutrino-3.0.theme b/data/themes/Neutrino-3.0.theme index 4be84fe71..9e7c32f41 100644 --- a/data/themes/Neutrino-3.0.theme +++ b/data/themes/Neutrino-3.0.theme @@ -8,6 +8,7 @@ colored_events_channellist=2 colored_events_green=70 colored_events_infobar=2 colored_events_red=95 +message_frame_enable=1 infobar_Text_alpha=0 infobar_Text_blue=100 infobar_Text_green=100 diff --git a/data/themes/Olive-3.0.theme b/data/themes/Olive-3.0.theme index c32fd64a1..7a28a6600 100644 --- a/data/themes/Olive-3.0.theme +++ b/data/themes/Olive-3.0.theme @@ -8,6 +8,7 @@ colored_events_channellist=2 colored_events_green=46 colored_events_infobar=2 colored_events_red=27 +message_frame_enable=1 infobar_Text_alpha=0 infobar_Text_blue=18 infobar_Text_green=20 diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 06f5b3a08..af5e4f5b3 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1026,6 +1026,11 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_SEPARATOR_ENABLE); menu_colors->addItem(oj); + // message frame + oj = new CMenuOptionChooser(LOCALE_MESSAGE_FRAME_ENABLE, &g_settings.theme.message_frame_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + oj->setHint("", LOCALE_MESSAGE_FRAME_ENABLE_HINT); + menu_colors->addItem(oj); + // round corners oj = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.theme.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this); oj->OnAfterChangeOption.connect(sigc::mem_fun(menu_colors, &CMenuWidget::hide)); diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 411141d35..2b2ee0e4f 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -395,6 +395,9 @@ void CThemes::setTheme(CConfigFile &configfile) // corners configfile.setInt32( "rounded_corners", t.rounded_corners); + + // message frames + configfile.setInt32( "message_frame_enable", t.message_frame_enable); } void CThemes::getTheme(CConfigFile &configfile) @@ -515,6 +518,9 @@ void CThemes::getTheme(CConfigFile &configfile) // corners t.rounded_corners = configfile.getInt32( "rounded_corners", 0); + // message frames + t.message_frame_enable = configfile.getInt32( "message_frame_enable", 0); + if (g_settings.theme_name.empty()) applyDefaultTheme(); } diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 418415b96..8175bbf06 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #define MSG_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MESSAGE_TEXT] @@ -164,7 +165,7 @@ void CHintBox::init( const std::string& Text, col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - fr_thickness = frame_width; + fr_thickness = g_settings.theme.message_frame_enable ? frame_width : 0; hb_font = MSG_FONT; diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 8ef7dc483..38de6c61a 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -34,6 +34,7 @@ #include "msgbox.h" #include +#include #define MAX_WINDOW_WIDTH (g_settings.screen_EndX - g_settings.screen_StartX ) #define MAX_WINDOW_HEIGHT (g_settings.screen_EndY - g_settings.screen_StartY - 40) @@ -104,7 +105,7 @@ void CMsgBox::init( const int& Height, col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - fr_thickness = frame_width; + fr_thickness = g_settings.theme.message_frame_enable ? frame_width : 0; //enable footer and add its height showFooter(true); diff --git a/src/system/locals.h b/src/system/locals.h index acb3897c9..9ba7dee63 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1815,6 +1815,8 @@ typedef enum LOCALE_MENU_HINT_YTPLAY_SETUP, LOCALE_MENU_HINT_ZAP_CYCLE, LOCALE_MENU_NEXT, + LOCALE_MESSAGE_FRAME_ENABLE, + LOCALE_MESSAGE_FRAME_ENABLE_HINT, LOCALE_MESSAGEBOX_BACK, LOCALE_MESSAGEBOX_CANCEL, LOCALE_MESSAGEBOX_DISCARD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0f09ab19c..17aef9d8e 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1815,6 +1815,8 @@ const char * locale_real_names[] = "menu.hint_ytplay_setup", "menu.hint_zap_cycle", "menu.next", + "message.frame_enable", + "message.frame_enable_hint", "messagebox.back", "messagebox.cancel", "messagebox.discard", diff --git a/src/system/settings.h b/src/system/settings.h index 5dbb0ffc0..a9e37f518 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -175,6 +175,7 @@ struct SNeutrinoTheme unsigned char progressbar_passive_blue; int rounded_corners; + int message_frame_enable; }; struct timer_remotebox_item