diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 8eaf85c68..afb41f50a 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -172,7 +172,7 @@ int CThemes::Show() int res = themes.exec(NULL, ""); - if (file_name.length() > 1) { + if (file_name.length() > 0) { saveFile((char*)((std::string)USERDIR + file_name + FILE_PREFIX).c_str()); } @@ -203,54 +203,7 @@ void CThemes::readFile(char* themename) { if(themefile.loadConfig(themename)) { - g_settings.theme.menu_Head_alpha = themefile.getInt32( "menu_Head_alpha", 0x00 ); - g_settings.theme.menu_Head_red = themefile.getInt32( "menu_Head_red", 0x00 ); - g_settings.theme.menu_Head_green = themefile.getInt32( "menu_Head_green", 0x0A ); - g_settings.theme.menu_Head_blue = themefile.getInt32( "menu_Head_blue", 0x19 ); - g_settings.theme.menu_Head_Text_alpha = themefile.getInt32( "menu_Head_Text_alpha", 0x00 ); - g_settings.theme.menu_Head_Text_red = themefile.getInt32( "menu_Head_Text_red", 0x5f ); - g_settings.theme.menu_Head_Text_green = themefile.getInt32( "menu_Head_Text_green", 0x46 ); - g_settings.theme.menu_Head_Text_blue = themefile.getInt32( "menu_Head_Text_blue", 0x00 ); - g_settings.theme.menu_Content_alpha = themefile.getInt32( "menu_Content_alpha", 0x14 ); - g_settings.theme.menu_Content_red = themefile.getInt32( "menu_Content_red", 0x00 ); - g_settings.theme.menu_Content_green = themefile.getInt32( "menu_Content_green", 0x0f ); - g_settings.theme.menu_Content_blue = themefile.getInt32( "menu_Content_blue", 0x23 ); - g_settings.theme.menu_Content_Text_alpha = themefile.getInt32( "menu_Content_Text_alpha", 0x00 ); - g_settings.theme.menu_Content_Text_red = themefile.getInt32( "menu_Content_Text_red", 0x64 ); - g_settings.theme.menu_Content_Text_green = themefile.getInt32( "menu_Content_Text_green", 0x64 ); - g_settings.theme.menu_Content_Text_blue = themefile.getInt32( "menu_Content_Text_blue", 0x64 ); - g_settings.theme.menu_Content_Selected_alpha = themefile.getInt32( "menu_Content_Selected_alpha", 0x14 ); - g_settings.theme.menu_Content_Selected_red = themefile.getInt32( "menu_Content_Selected_red", 0x19 ); - g_settings.theme.menu_Content_Selected_green = themefile.getInt32( "menu_Content_Selected_green", 0x37 ); - g_settings.theme.menu_Content_Selected_blue = themefile.getInt32( "menu_Content_Selected_blue", 0x64 ); - g_settings.theme.menu_Content_Selected_Text_alpha = themefile.getInt32( "menu_Content_Selected_Text_alpha", 0x00 ); - g_settings.theme.menu_Content_Selected_Text_red = themefile.getInt32( "menu_Content_Selected_Text_red", 0x00 ); - g_settings.theme.menu_Content_Selected_Text_green = themefile.getInt32( "menu_Content_Selected_Text_green", 0x00 ); - g_settings.theme.menu_Content_Selected_Text_blue = themefile.getInt32( "menu_Content_Selected_Text_blue", 0x00 ); - g_settings.theme.menu_Content_inactive_alpha = themefile.getInt32( "menu_Content_inactive_alpha", 0x14 ); - g_settings.theme.menu_Content_inactive_red = themefile.getInt32( "menu_Content_inactive_red", 0x00 ); - g_settings.theme.menu_Content_inactive_green = themefile.getInt32( "menu_Content_inactive_green", 0x0f ); - g_settings.theme.menu_Content_inactive_blue = themefile.getInt32( "menu_Content_inactive_blue", 0x23 ); - g_settings.theme.menu_Content_inactive_Text_alpha = themefile.getInt32( "menu_Content_inactive_Text_alpha", 0x00 ); - g_settings.theme.menu_Content_inactive_Text_red = themefile.getInt32( "menu_Content_inactive_Text_red", 55 ); - g_settings.theme.menu_Content_inactive_Text_green = themefile.getInt32( "menu_Content_inactive_Text_green", 70 ); - g_settings.theme.menu_Content_inactive_Text_blue = themefile.getInt32( "menu_Content_inactive_Text_blue", 85 ); - g_settings.theme.infobar_alpha = themefile.getInt32( "infobar_alpha", 0x14 ); - g_settings.theme.infobar_red = themefile.getInt32( "infobar_red", 0x00 ); - g_settings.theme.infobar_green = themefile.getInt32( "infobar_green", 0x0e ); - g_settings.theme.infobar_blue = themefile.getInt32( "infobar_blue", 0x23 ); - g_settings.theme.infobar_Text_alpha = themefile.getInt32( "infobar_Text_alpha", 0x00 ); - g_settings.theme.infobar_Text_red = themefile.getInt32( "infobar_Text_red", 0x64 ); - g_settings.theme.infobar_Text_green = themefile.getInt32( "infobar_Text_green", 0x64 ); - g_settings.theme.infobar_Text_blue = themefile.getInt32( "infobar_Text_blue", 0x64 ); - g_settings.theme.colored_events_alpha = themefile.getInt32( "colored_events_alpha", 0x00 ); - g_settings.theme.colored_events_red = themefile.getInt32( "colored_events_red", 95 ); - g_settings.theme.colored_events_green = themefile.getInt32( "colored_events_green", 70 ); - g_settings.theme.colored_events_blue = themefile.getInt32( "colored_events_blue", 0 ); - g_settings.theme.clock_Digit_alpha = themefile.getInt32( "clock_Digit_alpha", g_settings.theme.menu_Content_Text_alpha ); - g_settings.theme.clock_Digit_red = themefile.getInt32( "clock_Digit_red", g_settings.theme.menu_Content_Text_red ); - g_settings.theme.clock_Digit_green = themefile.getInt32( "clock_Digit_green", g_settings.theme.menu_Content_Text_green ); - g_settings.theme.clock_Digit_blue = themefile.getInt32( "clock_Digit_blue", g_settings.theme.menu_Content_Text_blue ); + getTheme(themefile); notifier = new CColorSetupNotifier; notifier->changeNotify(NONEXISTANT_LOCALE, NULL); @@ -263,64 +216,121 @@ void CThemes::readFile(char* themename) void CThemes::saveFile(char * themename) { - themefile.setInt32( "menu_Head_alpha", g_settings.theme.menu_Head_alpha ); - themefile.setInt32( "menu_Head_red", g_settings.theme.menu_Head_red ); - themefile.setInt32( "menu_Head_green", g_settings.theme.menu_Head_green ); - themefile.setInt32( "menu_Head_blue", g_settings.theme.menu_Head_blue ); - themefile.setInt32( "menu_Head_Text_alpha", g_settings.theme.menu_Head_Text_alpha ); - themefile.setInt32( "menu_Head_Text_red", g_settings.theme.menu_Head_Text_red ); - themefile.setInt32( "menu_Head_Text_green", g_settings.theme.menu_Head_Text_green ); - themefile.setInt32( "menu_Head_Text_blue", g_settings.theme.menu_Head_Text_blue ); - themefile.setInt32( "menu_Content_alpha", g_settings.theme.menu_Content_alpha ); - themefile.setInt32( "menu_Content_red", g_settings.theme.menu_Content_red ); - themefile.setInt32( "menu_Content_green", g_settings.theme.menu_Content_green ); - themefile.setInt32( "menu_Content_blue", g_settings.theme.menu_Content_blue ); - themefile.setInt32( "menu_Content_Text_alpha", g_settings.theme.menu_Content_Text_alpha ); - themefile.setInt32( "menu_Content_Text_red", g_settings.theme.menu_Content_Text_red ); - themefile.setInt32( "menu_Content_Text_green", g_settings.theme.menu_Content_Text_green ); - themefile.setInt32( "menu_Content_Text_blue", g_settings.theme.menu_Content_Text_blue ); - themefile.setInt32( "menu_Content_Selected_alpha", g_settings.theme.menu_Content_Selected_alpha ); - themefile.setInt32( "menu_Content_Selected_red", g_settings.theme.menu_Content_Selected_red ); - themefile.setInt32( "menu_Content_Selected_green", g_settings.theme.menu_Content_Selected_green ); - themefile.setInt32( "menu_Content_Selected_blue", g_settings.theme.menu_Content_Selected_blue ); - themefile.setInt32( "menu_Content_Selected_Text_alpha", g_settings.theme.menu_Content_Selected_Text_alpha ); - themefile.setInt32( "menu_Content_Selected_Text_red", g_settings.theme.menu_Content_Selected_Text_red ); - themefile.setInt32( "menu_Content_Selected_Text_green", g_settings.theme.menu_Content_Selected_Text_green ); - themefile.setInt32( "menu_Content_Selected_Text_blue", g_settings.theme.menu_Content_Selected_Text_blue ); - themefile.setInt32( "menu_Content_inactive_alpha", g_settings.theme.menu_Content_inactive_alpha ); - themefile.setInt32( "menu_Content_inactive_red", g_settings.theme.menu_Content_inactive_red ); - themefile.setInt32( "menu_Content_inactive_green", g_settings.theme.menu_Content_inactive_green ); - themefile.setInt32( "menu_Content_inactive_blue", g_settings.theme.menu_Content_inactive_blue ); - themefile.setInt32( "menu_Content_inactive_Text_alpha", g_settings.theme.menu_Content_inactive_Text_alpha ); - themefile.setInt32( "menu_Content_inactive_Text_red", g_settings.theme.menu_Content_inactive_Text_red ); - themefile.setInt32( "menu_Content_inactive_Text_green", g_settings.theme.menu_Content_inactive_Text_green ); - themefile.setInt32( "menu_Content_inactive_Text_blue", g_settings.theme.menu_Content_inactive_Text_blue ); - themefile.setInt32( "infobar_alpha", g_settings.theme.infobar_alpha ); - themefile.setInt32( "infobar_red", g_settings.theme.infobar_red ); - themefile.setInt32( "infobar_green", g_settings.theme.infobar_green ); - themefile.setInt32( "infobar_blue", g_settings.theme.infobar_blue ); - themefile.setInt32( "infobar_Text_alpha", g_settings.theme.infobar_Text_alpha ); - themefile.setInt32( "infobar_Text_red", g_settings.theme.infobar_Text_red ); - themefile.setInt32( "infobar_Text_green", g_settings.theme.infobar_Text_green ); - themefile.setInt32( "infobar_Text_blue", g_settings.theme.infobar_Text_blue ); - themefile.setInt32( "colored_events_alpha", g_settings.theme.colored_events_alpha ); - themefile.setInt32( "colored_events_red", g_settings.theme.colored_events_red ); - themefile.setInt32( "colored_events_green", g_settings.theme.colored_events_green ); - themefile.setInt32( "colored_events_blue", g_settings.theme.colored_events_blue ); - themefile.setInt32( "clock_Digit_alpha", g_settings.theme.clock_Digit_alpha ); - themefile.setInt32( "clock_Digit_red", g_settings.theme.clock_Digit_red ); - themefile.setInt32( "clock_Digit_green", g_settings.theme.clock_Digit_green ); - themefile.setInt32( "clock_Digit_blue", g_settings.theme.clock_Digit_blue ); + setTheme(themefile); if (!themefile.saveConfig(themename)) printf("[neutrino theme] %s write error\n", themename); } - - // setup default Colors void CThemes::setupDefaultColors() { CConfigFile empty(':'); - CNeutrinoApp::getInstance()->getTheme(empty); + getTheme(empty); +} + +void CThemes::setTheme(CConfigFile &configfile) +{ + SNeutrinoTheme &t = g_settings.theme; + configfile.setInt32( "menu_Head_alpha", t.menu_Head_alpha ); + configfile.setInt32( "menu_Head_red", t.menu_Head_red ); + configfile.setInt32( "menu_Head_green", t.menu_Head_green ); + configfile.setInt32( "menu_Head_blue", t.menu_Head_blue ); + configfile.setInt32( "menu_Head_Text_alpha", t.menu_Head_Text_alpha ); + configfile.setInt32( "menu_Head_Text_red", t.menu_Head_Text_red ); + configfile.setInt32( "menu_Head_Text_green", t.menu_Head_Text_green ); + configfile.setInt32( "menu_Head_Text_blue", t.menu_Head_Text_blue ); + configfile.setInt32( "menu_Content_alpha", t.menu_Content_alpha ); + configfile.setInt32( "menu_Content_red", t.menu_Content_red ); + configfile.setInt32( "menu_Content_green", t.menu_Content_green ); + configfile.setInt32( "menu_Content_blue", t.menu_Content_blue ); + configfile.setInt32( "menu_Content_Text_alpha", t.menu_Content_Text_alpha ); + configfile.setInt32( "menu_Content_Text_red", t.menu_Content_Text_red ); + configfile.setInt32( "menu_Content_Text_green", t.menu_Content_Text_green ); + configfile.setInt32( "menu_Content_Text_blue", t.menu_Content_Text_blue ); + configfile.setInt32( "menu_Content_Selected_alpha", t.menu_Content_Selected_alpha ); + configfile.setInt32( "menu_Content_Selected_red", t.menu_Content_Selected_red ); + configfile.setInt32( "menu_Content_Selected_green", t.menu_Content_Selected_green ); + configfile.setInt32( "menu_Content_Selected_blue", t.menu_Content_Selected_blue ); + configfile.setInt32( "menu_Content_Selected_Text_alpha", t.menu_Content_Selected_Text_alpha ); + configfile.setInt32( "menu_Content_Selected_Text_red", t.menu_Content_Selected_Text_red ); + configfile.setInt32( "menu_Content_Selected_Text_green", t.menu_Content_Selected_Text_green ); + configfile.setInt32( "menu_Content_Selected_Text_blue", t.menu_Content_Selected_Text_blue ); + configfile.setInt32( "menu_Content_inactive_alpha", t.menu_Content_inactive_alpha ); + configfile.setInt32( "menu_Content_inactive_red", t.menu_Content_inactive_red ); + configfile.setInt32( "menu_Content_inactive_green", t.menu_Content_inactive_green ); + configfile.setInt32( "menu_Content_inactive_blue", t.menu_Content_inactive_blue ); + configfile.setInt32( "menu_Content_inactive_Text_alpha", t.menu_Content_inactive_Text_alpha ); + configfile.setInt32( "menu_Content_inactive_Text_red", t.menu_Content_inactive_Text_red ); + configfile.setInt32( "menu_Content_inactive_Text_green", t.menu_Content_inactive_Text_green ); + configfile.setInt32( "menu_Content_inactive_Text_blue", t.menu_Content_inactive_Text_blue ); + configfile.setInt32( "infobar_alpha", t.infobar_alpha ); + configfile.setInt32( "infobar_red", t.infobar_red ); + configfile.setInt32( "infobar_green", t.infobar_green ); + configfile.setInt32( "infobar_blue", t.infobar_blue ); + configfile.setInt32( "infobar_Text_alpha", t.infobar_Text_alpha ); + configfile.setInt32( "infobar_Text_red", t.infobar_Text_red ); + configfile.setInt32( "infobar_Text_green", t.infobar_Text_green ); + configfile.setInt32( "infobar_Text_blue", t.infobar_Text_blue ); + configfile.setInt32( "colored_events_alpha", t.colored_events_alpha ); + configfile.setInt32( "colored_events_red", t.colored_events_red ); + configfile.setInt32( "colored_events_green", t.colored_events_green ); + configfile.setInt32( "colored_events_blue", t.colored_events_blue ); + configfile.setInt32( "clock_Digit_alpha", t.clock_Digit_alpha ); + configfile.setInt32( "clock_Digit_red", t.clock_Digit_red ); + configfile.setInt32( "clock_Digit_green", t.clock_Digit_green ); + configfile.setInt32( "clock_Digit_blue", t.clock_Digit_blue ); +} + +void CThemes::getTheme(CConfigFile &configfile) +{ + SNeutrinoTheme &t = g_settings.theme; + t.menu_Head_alpha = configfile.getInt32( "menu_Head_alpha", 0x00 ); + t.menu_Head_red = configfile.getInt32( "menu_Head_red", 0x00 ); + t.menu_Head_green = configfile.getInt32( "menu_Head_green", 0x0A ); + t.menu_Head_blue = configfile.getInt32( "menu_Head_blue", 0x19 ); + t.menu_Head_Text_alpha = configfile.getInt32( "menu_Head_Text_alpha", 0x00 ); + t.menu_Head_Text_red = configfile.getInt32( "menu_Head_Text_red", 0x5f ); + t.menu_Head_Text_green = configfile.getInt32( "menu_Head_Text_green", 0x46 ); + t.menu_Head_Text_blue = configfile.getInt32( "menu_Head_Text_blue", 0x00 ); + t.menu_Content_alpha = configfile.getInt32( "menu_Content_alpha", 0x14 ); + t.menu_Content_red = configfile.getInt32( "menu_Content_red", 0x00 ); + t.menu_Content_green = configfile.getInt32( "menu_Content_green", 0x0f ); + t.menu_Content_blue = configfile.getInt32( "menu_Content_blue", 0x23 ); + t.menu_Content_Text_alpha = configfile.getInt32( "menu_Content_Text_alpha", 0x00 ); + t.menu_Content_Text_red = configfile.getInt32( "menu_Content_Text_red", 0x64 ); + t.menu_Content_Text_green = configfile.getInt32( "menu_Content_Text_green", 0x64 ); + t.menu_Content_Text_blue = configfile.getInt32( "menu_Content_Text_blue", 0x64 ); + t.menu_Content_Selected_alpha = configfile.getInt32( "menu_Content_Selected_alpha", 0x14 ); + t.menu_Content_Selected_red = configfile.getInt32( "menu_Content_Selected_red", 0x19 ); + t.menu_Content_Selected_green = configfile.getInt32( "menu_Content_Selected_green", 0x37 ); + t.menu_Content_Selected_blue = configfile.getInt32( "menu_Content_Selected_blue", 0x64 ); + t.menu_Content_Selected_Text_alpha = configfile.getInt32( "menu_Content_Selected_Text_alpha", 0x00 ); + t.menu_Content_Selected_Text_red = configfile.getInt32( "menu_Content_Selected_Text_red", 0x00 ); + t.menu_Content_Selected_Text_green = configfile.getInt32( "menu_Content_Selected_Text_green", 0x00 ); + t.menu_Content_Selected_Text_blue = configfile.getInt32( "menu_Content_Selected_Text_blue", 0x00 ); + t.menu_Content_inactive_alpha = configfile.getInt32( "menu_Content_inactive_alpha", 0x14 ); + t.menu_Content_inactive_red = configfile.getInt32( "menu_Content_inactive_red", 0x00 ); + t.menu_Content_inactive_green = configfile.getInt32( "menu_Content_inactive_green", 0x0f ); + t.menu_Content_inactive_blue = configfile.getInt32( "menu_Content_inactive_blue", 0x23 ); + t.menu_Content_inactive_Text_alpha = configfile.getInt32( "menu_Content_inactive_Text_alpha", 0x00 ); + t.menu_Content_inactive_Text_red = configfile.getInt32( "menu_Content_inactive_Text_red", 55 ); + t.menu_Content_inactive_Text_green = configfile.getInt32( "menu_Content_inactive_Text_green", 70 ); + t.menu_Content_inactive_Text_blue = configfile.getInt32( "menu_Content_inactive_Text_blue", 85 ); + t.infobar_alpha = configfile.getInt32( "infobar_alpha", 0x14 ); + t.infobar_red = configfile.getInt32( "infobar_red", 0x00 ); + t.infobar_green = configfile.getInt32( "infobar_green", 0x0e ); + t.infobar_blue = configfile.getInt32( "infobar_blue", 0x23 ); + t.infobar_Text_alpha = configfile.getInt32( "infobar_Text_alpha", 0x00 ); + t.infobar_Text_red = configfile.getInt32( "infobar_Text_red", 0x64 ); + t.infobar_Text_green = configfile.getInt32( "infobar_Text_green", 0x64 ); + t.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 ); + t.colored_events_alpha = configfile.getInt32( "colored_events_alpha", 0x00 ); + t.colored_events_red = configfile.getInt32( "colored_events_red", 95 ); + t.colored_events_green = configfile.getInt32( "colored_events_green", 70 ); + t.colored_events_blue = configfile.getInt32( "colored_events_blue", 0 ); + t.clock_Digit_alpha = configfile.getInt32( "clock_Digit_alpha", t.menu_Content_Text_alpha ); + t.clock_Digit_red = configfile.getInt32( "clock_Digit_red", t.menu_Content_Text_red ); + t.clock_Digit_green = configfile.getInt32( "clock_Digit_green", t.menu_Content_Text_green ); + t.clock_Digit_blue = configfile.getInt32( "clock_Digit_blue", t.menu_Content_Text_blue ); } diff --git a/src/gui/themes.h b/src/gui/themes.h index 6c1ce46bf..981d6cc4a 100644 --- a/src/gui/themes.h +++ b/src/gui/themes.h @@ -49,6 +49,8 @@ class CThemes : public CMenuTarget, CChangeObserver CThemes(); void setupDefaultColors(); int exec(CMenuTarget* parent, const std::string & actionKey); + static void setTheme(CConfigFile &configfile); + static void getTheme(CConfigFile &configfile); }; #endif diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9d1e43f63..5a8fe00fa 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -97,6 +97,7 @@ #ifdef ENABLE_PIP #include "gui/pipsetup.h" #endif +#include "gui/themes.h" #include #include @@ -510,60 +511,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.widget_fade = false; g_settings.widget_fade = configfile.getBool("widget_fade" , false ); - //colors (neutrino defaultcolors) - g_settings.theme.clock_Digit_alpha = configfile.getInt32( "clock_Digit_alpha", 0x00 ); - g_settings.theme.clock_Digit_red = configfile.getInt32( "clock_Digit_red", 0x64 ); - g_settings.theme.clock_Digit_green = configfile.getInt32( "clock_Digit_green", 0x64 ); - g_settings.theme.clock_Digit_blue = configfile.getInt32( "clock_Digit_blue", 0x64 ); - - g_settings.theme.menu_Head_alpha = configfile.getInt32( "menu_Head_alpha", 0x00 ); - g_settings.theme.menu_Head_red = configfile.getInt32( "menu_Head_red", 0x00 ); - g_settings.theme.menu_Head_green = configfile.getInt32( "menu_Head_green", 0x0A ); - g_settings.theme.menu_Head_blue = configfile.getInt32( "menu_Head_blue", 0x19 ); - - g_settings.theme.menu_Head_Text_alpha = configfile.getInt32( "menu_Head_Text_alpha", 0x00 ); - g_settings.theme.menu_Head_Text_red = configfile.getInt32( "menu_Head_Text_red", 0x5f ); - g_settings.theme.menu_Head_Text_green = configfile.getInt32( "menu_Head_Text_green", 0x46 ); - g_settings.theme.menu_Head_Text_blue = configfile.getInt32( "menu_Head_Text_blue", 0x00 ); - - g_settings.theme.menu_Content_alpha = configfile.getInt32( "menu_Content_alpha", 0x14 ); - g_settings.theme.menu_Content_red = configfile.getInt32( "menu_Content_red", 0x00 ); - g_settings.theme.menu_Content_green = configfile.getInt32( "menu_Content_green", 0x0f ); - g_settings.theme.menu_Content_blue = configfile.getInt32( "menu_Content_blue", 0x23 ); - g_settings.theme.menu_Content_Text_alpha = configfile.getInt32( "menu_Content_Text_alpha", 0x00 ); - g_settings.theme.menu_Content_Text_red = configfile.getInt32( "menu_Content_Text_red", 0x64 ); - g_settings.theme.menu_Content_Text_green = configfile.getInt32( "menu_Content_Text_green", 0x64 ); - g_settings.theme.menu_Content_Text_blue = configfile.getInt32( "menu_Content_Text_blue", 0x64 ); - - g_settings.theme.menu_Content_Selected_alpha = configfile.getInt32( "menu_Content_Selected_alpha", 0x14 ); - g_settings.theme.menu_Content_Selected_red = configfile.getInt32( "menu_Content_Selected_red", 0x19 ); - g_settings.theme.menu_Content_Selected_green = configfile.getInt32( "menu_Content_Selected_green", 0x37 ); - g_settings.theme.menu_Content_Selected_blue = configfile.getInt32( "menu_Content_Selected_blue", 0x64 ); - - g_settings.theme.menu_Content_Selected_Text_alpha = configfile.getInt32( "menu_Content_Selected_Text_alpha", 0x00 ); - g_settings.theme.menu_Content_Selected_Text_red = configfile.getInt32( "menu_Content_Selected_Text_red", 0x00 ); - g_settings.theme.menu_Content_Selected_Text_green = configfile.getInt32( "menu_Content_Selected_Text_green", 0x00 ); - g_settings.theme.menu_Content_Selected_Text_blue = configfile.getInt32( "menu_Content_Selected_Text_blue", 0x00 ); - - g_settings.theme.menu_Content_inactive_alpha = configfile.getInt32( "menu_Content_inactive_alpha", 0x14 ); - g_settings.theme.menu_Content_inactive_red = configfile.getInt32( "menu_Content_inactive_red", 0x00 ); - g_settings.theme.menu_Content_inactive_green = configfile.getInt32( "menu_Content_inactive_green", 0x0f ); - g_settings.theme.menu_Content_inactive_blue = configfile.getInt32( "menu_Content_inactive_blue", 0x23 ); - - g_settings.theme.menu_Content_inactive_Text_alpha = configfile.getInt32( "menu_Content_inactive_Text_alpha", 0x00 ); - g_settings.theme.menu_Content_inactive_Text_red = configfile.getInt32( "menu_Content_inactive_Text_red", 55 ); - g_settings.theme.menu_Content_inactive_Text_green = configfile.getInt32( "menu_Content_inactive_Text_green", 70 ); - g_settings.theme.menu_Content_inactive_Text_blue = configfile.getInt32( "menu_Content_inactive_Text_blue", 85 ); - - g_settings.theme.infobar_alpha = configfile.getInt32( "infobar_alpha", 0x14 ); - g_settings.theme.infobar_red = configfile.getInt32( "infobar_red", 0x00 ); - g_settings.theme.infobar_green = configfile.getInt32( "infobar_green", 0x0e ); - g_settings.theme.infobar_blue = configfile.getInt32( "infobar_blue", 0x23 ); - - g_settings.theme.infobar_Text_alpha = configfile.getInt32( "infobar_Text_alpha", 0x00 ); - g_settings.theme.infobar_Text_red = configfile.getInt32( "infobar_Text_red", 0x64 ); - g_settings.theme.infobar_Text_green = configfile.getInt32( "infobar_Text_green", 0x64 ); - g_settings.theme.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 ); + CThemes::getTheme(configfile); //personalize g_settings.personalize_pincode = configfile.getString( "personalize_pincode", "0000" ); @@ -572,10 +520,6 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.colored_events_channellist = configfile.getInt32( "colored_events_channellist" , 0 ); g_settings.colored_events_infobar = configfile.getInt32( "colored_events_infobar" , 2 ); // next - g_settings.theme.colored_events_alpha = configfile.getInt32( "colored_events_alpha", 0x00 ); - g_settings.theme.colored_events_red = configfile.getInt32( "colored_events_red", 95 ); - g_settings.theme.colored_events_green = configfile.getInt32( "colored_events_green", 70 ); - g_settings.theme.colored_events_blue = configfile.getInt32( "colored_events_blue", 0 ); g_settings.contrast_fonts = configfile.getInt32("contrast_fonts", 0); @@ -1061,61 +1005,7 @@ void CNeutrinoApp::saveSetup(const char * fname) //widget settings configfile.setBool("widget_fade" , g_settings.widget_fade ); - //colors - configfile.setInt32( "clock_Digit_alpha", g_settings.theme.clock_Digit_alpha ); - configfile.setInt32( "clock_Digit_red", g_settings.theme.clock_Digit_red ); - configfile.setInt32( "clock_Digit_green", g_settings.theme.clock_Digit_green ); - configfile.setInt32( "clock_Digit_blue", g_settings.theme.clock_Digit_blue ); - - configfile.setInt32( "menu_Head_alpha", g_settings.theme.menu_Head_alpha ); - configfile.setInt32( "menu_Head_red", g_settings.theme.menu_Head_red ); - configfile.setInt32( "menu_Head_green", g_settings.theme.menu_Head_green ); - configfile.setInt32( "menu_Head_blue", g_settings.theme.menu_Head_blue ); - - configfile.setInt32( "menu_Head_Text_alpha", g_settings.theme.menu_Head_Text_alpha ); - configfile.setInt32( "menu_Head_Text_red", g_settings.theme.menu_Head_Text_red ); - configfile.setInt32( "menu_Head_Text_green", g_settings.theme.menu_Head_Text_green ); - configfile.setInt32( "menu_Head_Text_blue", g_settings.theme.menu_Head_Text_blue ); - - configfile.setInt32( "menu_Content_alpha", g_settings.theme.menu_Content_alpha ); - configfile.setInt32( "menu_Content_red", g_settings.theme.menu_Content_red ); - configfile.setInt32( "menu_Content_green", g_settings.theme.menu_Content_green ); - configfile.setInt32( "menu_Content_blue", g_settings.theme.menu_Content_blue ); - - configfile.setInt32( "menu_Content_Text_alpha", g_settings.theme.menu_Content_Text_alpha ); - configfile.setInt32( "menu_Content_Text_red", g_settings.theme.menu_Content_Text_red ); - configfile.setInt32( "menu_Content_Text_green", g_settings.theme.menu_Content_Text_green ); - configfile.setInt32( "menu_Content_Text_blue", g_settings.theme.menu_Content_Text_blue ); - - configfile.setInt32( "menu_Content_Selected_alpha", g_settings.theme.menu_Content_Selected_alpha ); - configfile.setInt32( "menu_Content_Selected_red", g_settings.theme.menu_Content_Selected_red ); - configfile.setInt32( "menu_Content_Selected_green", g_settings.theme.menu_Content_Selected_green ); - configfile.setInt32( "menu_Content_Selected_blue", g_settings.theme.menu_Content_Selected_blue ); - - configfile.setInt32( "menu_Content_Selected_Text_alpha", g_settings.theme.menu_Content_Selected_Text_alpha ); - configfile.setInt32( "menu_Content_Selected_Text_red", g_settings.theme.menu_Content_Selected_Text_red ); - configfile.setInt32( "menu_Content_Selected_Text_green", g_settings.theme.menu_Content_Selected_Text_green ); - configfile.setInt32( "menu_Content_Selected_Text_blue", g_settings.theme.menu_Content_Selected_Text_blue ); - - configfile.setInt32( "menu_Content_inactive_alpha", g_settings.theme.menu_Content_inactive_alpha ); - configfile.setInt32( "menu_Content_inactive_red", g_settings.theme.menu_Content_inactive_red ); - configfile.setInt32( "menu_Content_inactive_green", g_settings.theme.menu_Content_inactive_green ); - configfile.setInt32( "menu_Content_inactive_blue", g_settings.theme.menu_Content_inactive_blue ); - - configfile.setInt32( "menu_Content_inactive_Text_alpha", g_settings.theme.menu_Content_inactive_Text_alpha ); - configfile.setInt32( "menu_Content_inactive_Text_red", g_settings.theme.menu_Content_inactive_Text_red ); - configfile.setInt32( "menu_Content_inactive_Text_green", g_settings.theme.menu_Content_inactive_Text_green ); - configfile.setInt32( "menu_Content_inactive_Text_blue", g_settings.theme.menu_Content_inactive_Text_blue ); - - configfile.setInt32( "infobar_alpha", g_settings.theme.infobar_alpha ); - configfile.setInt32( "infobar_red", g_settings.theme.infobar_red ); - configfile.setInt32( "infobar_green", g_settings.theme.infobar_green ); - configfile.setInt32( "infobar_blue", g_settings.theme.infobar_blue ); - - configfile.setInt32( "infobar_Text_alpha", g_settings.theme.infobar_Text_alpha ); - configfile.setInt32( "infobar_Text_red", g_settings.theme.infobar_Text_red ); - configfile.setInt32( "infobar_Text_green", g_settings.theme.infobar_Text_green ); - configfile.setInt32( "infobar_Text_blue", g_settings.theme.infobar_Text_blue ); + CThemes::setTheme(configfile); //personalize configfile.setString("personalize_pincode", g_settings.personalize_pincode); @@ -1124,10 +1014,6 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "colored_events_channellist", g_settings.colored_events_channellist ); configfile.setInt32( "colored_events_infobar", g_settings.colored_events_infobar ); - configfile.setInt32( "colored_events_alpha", g_settings.theme.colored_events_alpha ); - configfile.setInt32( "colored_events_red", g_settings.theme.colored_events_red ); - configfile.setInt32( "colored_events_green", g_settings.theme.colored_events_green ); - configfile.setInt32( "colored_events_blue", g_settings.theme.colored_events_blue ); configfile.setInt32( "contrast_fonts", g_settings.contrast_fonts ); //network