diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index b36b49c626..a0de45d3e3 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -670,6 +670,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
670 | { | 670 | { |
671 | int numeric_ret = -1; | 671 | int numeric_ret = -1; |
672 | const char *numeric_buf = "?"; | 672 | const char *numeric_buf = "?"; |
673 | int fmt_size; | ||
673 | 674 | ||
674 | if (!gwps) | 675 | if (!gwps) |
675 | return NULL; | 676 | return NULL; |
@@ -886,7 +887,18 @@ const char *get_token_value(struct gui_wps *gwps, | |||
886 | break; | 887 | break; |
887 | 888 | ||
888 | case SKIN_TOKEN_VOLUME: | 889 | case SKIN_TOKEN_VOLUME: |
889 | snprintf(buf, buf_size, "%d", global_settings.volume); | 890 | fmt_size = format_sound_value(buf, buf_size, SOUND_VOLUME, |
891 | global_settings.volume); | ||
892 | /* FIXME: this is a cheap hack to avoid breaking existing themes. | ||
893 | * The new formatting includes a unit based on the AUDIOHW_SETTING | ||
894 | * definition -- on all targets, it's defined to be "dB". But the | ||
895 | * old formatting was just an integer value, and many themes append | ||
896 | * "dB" manually. So we need to strip the unit to unbreak all those | ||
897 | * existing themes. | ||
898 | */ | ||
899 | if(fmt_size >= 3 && !strcmp(&buf[fmt_size - 3], " dB")) | ||
900 | buf[fmt_size - 3] = 0; | ||
901 | |||
890 | if (intval) | 902 | if (intval) |
891 | { | 903 | { |
892 | int minvol = sound_min(SOUND_VOLUME); | 904 | int minvol = sound_min(SOUND_VOLUME); |