themes: move rounded corners to theme section

Origin commit data
------------------
Branch: ni/coolstream
Commit: 77b62807db
Author: Thilo Graf <dbt@novatux.de>
Date: 2019-02-11 (Mon, 11 Feb 2019)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2019-02-11 21:49:08 +01:00
committed by vanhofen
parent 9857d6243b
commit 16054dec6e
14 changed files with 35 additions and 17 deletions

View File

@@ -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);

View File

@@ -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 },

View File

@@ -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)) {

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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)