diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d97d96cc7..04c3a8c4b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -369,7 +369,7 @@ colormenu.clock_textcolor Ziffernfarbe colormenu.fade Ein-/Ausblenden colormenu.font Verwendete Schriftart colormenu.font_ttx Teletext Schriftart -colormenu.menucolors Farben +colormenu.menucolors Themes colormenu.osd_preset Monitor Auswahl colormenu.osd_resolution OSD-Auflösung colormenu.progressbar_active Farbe des aktiven Teil diff --git a/data/locale/english.locale b/data/locale/english.locale index a96cea489..4c58b46b2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -369,7 +369,7 @@ colormenu.clock_textcolor Digit color colormenu.fade Fade GUI colormenu.font Select GUI font colormenu.font_ttx Select Teletext font -colormenu.menucolors Colors +colormenu.menucolors Themes colormenu.osd_preset TV preset colormenu.osd_resolution OSD resolution colormenu.progressbar_active Active part color diff --git a/data/themes/Bluemoon-3.0.theme b/data/themes/Bluemoon-3.0.theme index 1b18e72cf..53870d602 100644 --- a/data/themes/Bluemoon-3.0.theme +++ b/data/themes/Bluemoon-3.0.theme @@ -65,3 +65,4 @@ menu_Head_red=0 menu_Hint_gradient=1 menu_Hint_gradient_direction=1 menu_Separator_gradient_enable=1 +rounded_corners=0 diff --git a/data/themes/Classic.theme b/data/themes/Classic.theme index ddcaf5048..8eb850448 100644 --- a/data/themes/Classic.theme +++ b/data/themes/Classic.theme @@ -42,3 +42,4 @@ menu_Hint_gradient=0 menu_Head_gradient=0 infobar_gradient_top=0 infobar_gradient_bottom=0 +rounded_corners=1 diff --git a/data/themes/Neutrino-3.0.theme b/data/themes/Neutrino-3.0.theme index 1bf024935..c18a34788 100644 --- a/data/themes/Neutrino-3.0.theme +++ b/data/themes/Neutrino-3.0.theme @@ -65,3 +65,4 @@ menu_Head_red=0 menu_Hint_gradient=2 menu_Hint_gradient_direction=1 menu_Separator_gradient_enable=1 +rounded_corners=0 diff --git a/data/themes/Olive-3.0.theme b/data/themes/Olive-3.0.theme index b16933cbe..db6214e88 100644 --- a/data/themes/Olive-3.0.theme +++ b/data/themes/Olive-3.0.theme @@ -63,3 +63,4 @@ menu_Head_red=66 menu_Hint_gradient=3 menu_Hint_gradient_direction=0 menu_Separator_gradient_enable=1 +rounded_corners=0 diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index 27d7292d3..1a86eac16 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -82,7 +82,7 @@ void CInfoClock::initCCLockItems() initClockFont(0, height); // set corner radius depending on clock height - corner_rad = (g_settings.rounded_corners) ? std::max(height/10, CORNER_RADIUS_SMALL) : 0; + corner_rad = (g_settings.theme.rounded_corners) ? std::max(height/10, CORNER_RADIUS_SMALL) : 0; CVolumeHelper::getInstance()->refresh(cl_font); CVolumeHelper::getInstance()->getInfoClockDimensions(&x, &y, &width, &height); diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 480c90a4a..a6aa8c6c0 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -278,7 +278,7 @@ static void set_lua_variables(lua_State *L) { "TOP_RIGHT", CORNER_TOP_RIGHT }, { "BOTTOM_LEFT", CORNER_BOTTOM_LEFT }, { "BOTTOM_RIGHT", CORNER_BOTTOM_RIGHT }, - { "RADIUS_LARGE", RADIUS_LARGE }, /* those depend on g_settings.rounded_corners */ + { "RADIUS_LARGE", RADIUS_LARGE }, /* those depend on g_settings.theme.rounded_corners */ { "RADIUS_MID", RADIUS_MID }, { "RADIUS_SMALL", RADIUS_SMALL }, { "RADIUS_MIN", RADIUS_MIN }, diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 9afd0e397..5b9e4030b 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -727,11 +727,12 @@ int COsdSetup::showOsdSetup() #endif osd_menu->addItem(GenericMenuSeparatorLine); - +#if 0 // round corners - mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this); + mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.theme.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_ROUNDED_CORNERS); osd_menu->addItem(mc); +#endif #if !HAVE_ARM_HARDWARE //FIXME: make it usable for AX51 // fade windows mc = new CMenuOptionChooser(LOCALE_COLORMENU_FADE, &g_settings.widget_fade, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true ); @@ -1009,6 +1010,12 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) oj->OnAfterChangeOption.connect(slot_repaint); oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_SEPARATOR_ENABLE); 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)); + oj->setHint("", LOCALE_MENU_HINT_ROUNDED_CORNERS); + menu_colors->addItem(oj); } /* for font size setup */ @@ -1589,7 +1596,7 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) #endif else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_ROUNDED_CORNERS)) { osd_menu->hide(); - g_settings.rounded_corners = * (int*) data; + g_settings.theme.rounded_corners = * (int*) data; return true; } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_RADIOTEXT)) { diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 033abd840..15ee533ae 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -387,6 +387,9 @@ void CThemes::setTheme(CConfigFile &configfile) configfile.setInt32( "progressbar_passive_red", t.progressbar_passive_red ); configfile.setInt32( "progressbar_passive_green", t.progressbar_passive_green ); configfile.setInt32( "progressbar_passive_blue", t.progressbar_passive_blue ); + + // corners + configfile.setInt32( "rounded_corners", t.rounded_corners); } void CThemes::getTheme(CConfigFile &configfile) @@ -500,6 +503,9 @@ void CThemes::getTheme(CConfigFile &configfile) t.progressbar_passive_green = configfile.getInt32( "progressbar_passive_green", 26 ); t.progressbar_passive_blue = configfile.getInt32( "progressbar_passive_blue", 26 ); + // corners + t.rounded_corners = configfile.getInt32( "rounded_corners", 1); + if (g_settings.theme_name.empty()) applyDefaultTheme(); } diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp index e4a4f65f9..078b85d71 100644 --- a/src/gui/timeosd.cpp +++ b/src/gui/timeosd.cpp @@ -70,7 +70,7 @@ void CTimeOSD::Init() setClockFont(CInfoClock::getInstance()->getClockFont()); // set corner radius depending on clock height - corner_rad = (g_settings.rounded_corners) ? std::max(height/10, CORNER_RADIUS_SMALL) : 0; + corner_rad = (g_settings.theme.rounded_corners) ? std::max(height/10, CORNER_RADIUS_SMALL) : 0; CComponentsFrmClock::initCCLockItems(); CVolumeHelper::getInstance()->refresh(cl_font); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 06c66ec05..0d31b6b5d 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1344,7 +1344,7 @@ void CMenuWidget::initSelectable() void CMenuWidget::paint() { if (header){ - if ((bool)header->getCornerRadius() != (bool)g_settings.rounded_corners) //ensure reset if corner mode was changed + if ((bool)header->getCornerRadius() != (bool)g_settings.theme.rounded_corners) //ensure reset if corner mode was changed ResetModules(); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d976afbcc..9e5048ecc 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -479,7 +479,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.cpufreq = 0; g_settings.standby_cpufreq = 50; #endif - g_settings.rounded_corners = configfile.getInt32("rounded_corners", 0); //NI + g_settings.ci_standby_reset = configfile.getInt32("ci_standby_reset", 0); #if HAVE_ARM_HARDWARE g_settings.ci_clock = configfile.getInt32("ci_clock", 6); @@ -1420,7 +1420,7 @@ void CNeutrinoApp::saveSetup(const char * fname) } configfile.setInt32( "cpufreq", g_settings.cpufreq); configfile.setInt32( "standby_cpufreq", g_settings.standby_cpufreq); - configfile.setInt32("rounded_corners", g_settings.rounded_corners); + configfile.setInt32("ci_standby_reset", g_settings.ci_standby_reset); configfile.setInt32("ci_clock", g_settings.ci_clock); configfile.setInt32("ci_ignore_messages", g_settings.ci_ignore_messages); diff --git a/src/system/settings.h b/src/system/settings.h index 93c925da1..6d0528a3a 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -169,6 +169,8 @@ struct SNeutrinoTheme unsigned char progressbar_passive_red; unsigned char progressbar_passive_green; unsigned char progressbar_passive_blue; + + int rounded_corners; }; struct timer_remotebox_item @@ -277,7 +279,6 @@ struct SNeutrinoSettings int show_empty_favorites; int avsync; int clockrec; - int rounded_corners; int ci_standby_reset; int ci_clock; int ci_ignore_messages; @@ -1056,11 +1057,11 @@ const time_settings_struct_t handling_infobar_setting[SNeutrinoSettings::HANDLIN #define CORNER_RADIUS_MIN CFrameBuffer::getInstance()->scale2Res(3) #define CORNER_RADIUS_NONE 0 -#define RADIUS_LARGE (g_settings.rounded_corners ? CORNER_RADIUS_LARGE : CORNER_RADIUS_NONE) -#define RADIUS_MID (g_settings.rounded_corners ? CORNER_RADIUS_MID : CORNER_RADIUS_NONE) -#define RADIUS_SMALL (g_settings.rounded_corners ? CORNER_RADIUS_SMALL : CORNER_RADIUS_NONE) -#define RADIUS_MIN (g_settings.rounded_corners ? CORNER_RADIUS_MIN : CORNER_RADIUS_NONE) -#define RADIUS_NONE 0 +#define RADIUS_LARGE (g_settings.theme.rounded_corners ? CORNER_RADIUS_LARGE : CORNER_RADIUS_NONE) +#define RADIUS_MID (g_settings.theme.rounded_corners ? CORNER_RADIUS_MID : CORNER_RADIUS_NONE) +#define RADIUS_SMALL (g_settings.theme.rounded_corners ? CORNER_RADIUS_SMALL : CORNER_RADIUS_NONE) +#define RADIUS_MIN (g_settings.theme.rounded_corners ? CORNER_RADIUS_MIN : CORNER_RADIUS_NONE) +#define RADIUS_NONE 0 // offsets #define OFFSET_SHADOW CFrameBuffer::getInstance()->scale2Res(6)