Be less smart about when to reload skins as it caused more problems than it was worth. If any theme setting is loading from a .cfg reload all skins. Fixes FS#12410
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31081 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
25bce232f2
commit
d66592bad1
2 changed files with 14 additions and 19 deletions
|
@ -139,16 +139,8 @@ void settings_apply_skins(void)
|
||||||
{
|
{
|
||||||
FOR_NB_SCREENS(j)
|
FOR_NB_SCREENS(j)
|
||||||
{
|
{
|
||||||
bool load = false;
|
|
||||||
get_skin_filename(filename, MAX_PATH, i,j);
|
get_skin_filename(filename, MAX_PATH, i,j);
|
||||||
|
|
||||||
if (filename[0] && (strcmp(filename, skins[i][j].filename) || skins[i][j].failsafe_loaded))
|
|
||||||
load = true;
|
|
||||||
else if (first_run || (!filename[0] && !skins[i][j].failsafe_loaded))
|
|
||||||
load = true;
|
|
||||||
|
|
||||||
if (load)
|
|
||||||
{
|
|
||||||
if (!first_run)
|
if (!first_run)
|
||||||
{
|
{
|
||||||
skin_data_free_buflib_allocs(&skins[i][j].data);
|
skin_data_free_buflib_allocs(&skins[i][j].data);
|
||||||
|
@ -163,7 +155,6 @@ void settings_apply_skins(void)
|
||||||
skin_get_gwps(i, j);
|
skin_get_gwps(i, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
first_run = false;
|
first_run = false;
|
||||||
viewportmanager_theme_changed(THEME_STATUSBAR);
|
viewportmanager_theme_changed(THEME_STATUSBAR);
|
||||||
#ifdef HAVE_BACKDROP_IMAGE
|
#ifdef HAVE_BACKDROP_IMAGE
|
||||||
|
|
|
@ -268,6 +268,7 @@ bool settings_load_config(const char* file, bool apply)
|
||||||
char* name;
|
char* name;
|
||||||
char* value;
|
char* value;
|
||||||
int i;
|
int i;
|
||||||
|
bool theme_changed = false;
|
||||||
fd = open_utf8(file, O_RDONLY);
|
fd = open_utf8(file, O_RDONLY);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return false;
|
return false;
|
||||||
|
@ -282,6 +283,8 @@ bool settings_load_config(const char* file, bool apply)
|
||||||
continue;
|
continue;
|
||||||
if (!strcasecmp(name,settings[i].cfg_name))
|
if (!strcasecmp(name,settings[i].cfg_name))
|
||||||
{
|
{
|
||||||
|
if (settings[i].flags&F_THEMESETTING)
|
||||||
|
theme_changed = true;
|
||||||
switch (settings[i].flags&F_T_MASK)
|
switch (settings[i].flags&F_T_MASK)
|
||||||
{
|
{
|
||||||
case F_T_CUSTOM:
|
case F_T_CUSTOM:
|
||||||
|
@ -363,6 +366,7 @@ bool settings_load_config(const char* file, bool apply)
|
||||||
{
|
{
|
||||||
settings_save();
|
settings_save();
|
||||||
settings_apply(true);
|
settings_apply(true);
|
||||||
|
if (theme_changed)
|
||||||
settings_apply_skins();
|
settings_apply_skins();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue