mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
don't reload the skins if color isn't actually changed.
reload skins when colors are reset. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28219 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6bd9a31b0b
commit
09d8975084
1 changed files with 9 additions and 5 deletions
|
|
@ -86,19 +86,22 @@ static struct colour_info
|
||||||
*/
|
*/
|
||||||
static int set_color_func(void* color)
|
static int set_color_func(void* color)
|
||||||
{
|
{
|
||||||
int res, c = (intptr_t)color, banned_color=-1;
|
int res, c = (intptr_t)color, banned_color=-1, old_color;
|
||||||
|
|
||||||
/* Don't let foreground be set the same as background and vice-versa */
|
/* Don't let foreground be set the same as background and vice-versa */
|
||||||
if (c == COLOR_BG)
|
if (c == COLOR_BG)
|
||||||
banned_color = *colors[COLOR_FG].setting;
|
banned_color = *colors[COLOR_FG].setting;
|
||||||
else if (c == COLOR_FG)
|
else if (c == COLOR_FG)
|
||||||
banned_color = *colors[COLOR_BG].setting;
|
banned_color = *colors[COLOR_BG].setting;
|
||||||
|
|
||||||
|
old_color = *colors[c].setting;
|
||||||
res = (int)set_color(&screens[SCREEN_MAIN],str(colors[c].lang_id),
|
res = (int)set_color(&screens[SCREEN_MAIN],str(colors[c].lang_id),
|
||||||
colors[c].setting, banned_color);
|
colors[c].setting, banned_color);
|
||||||
|
if (old_color != *colors[c].setting)
|
||||||
|
{
|
||||||
settings_save();
|
settings_save();
|
||||||
settings_apply(false);
|
settings_apply(false);
|
||||||
settings_apply_skins();
|
settings_apply_skins();
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,6 +115,7 @@ static int reset_color(void)
|
||||||
|
|
||||||
settings_save();
|
settings_save();
|
||||||
settings_apply(false);
|
settings_apply(false);
|
||||||
|
settings_apply_skins();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
MENUITEM_FUNCTION(set_bg_col, MENU_FUNC_USEPARAM, ID2P(LANG_BACKGROUND_COLOR),
|
MENUITEM_FUNCTION(set_bg_col, MENU_FUNC_USEPARAM, ID2P(LANG_BACKGROUND_COLOR),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue