summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-19 15:28:15 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-19 15:28:15 +0000
commit1016ee4e809776619fa9e4e773ceb1523bd7bc66 (patch)
tree585cd873c118bee7c2459205e6eb54ff3e76a21b /apps/settings.c
parent00695baac0b797cbe46e7bc2999a83f73b36aae8 (diff)
downloadrockbox-1016ee4e809776619fa9e4e773ceb1523bd7bc66.tar.gz
rockbox-1016ee4e809776619fa9e4e773ceb1523bd7bc66.zip
Initial custom statusbar commit.
The custom statusbar can be used as a WPS for the main UI, using .(r)sbs files. It's using the skin engine and knows all tags the WPS also knows. The default folder for .sbs is the wps folder to reuse images used in the WPS. As it can be shown in the WPS also, it's useful to move shared parts to the custom statusbar in order to save skin buffer space. There are a few restrictions/TODOs: *) Peak meter doesn't redraw nicely(not frequent enough), as very frequent updates would slow the UI down as hell (some targets fight with it in the WPS already: FS#10686) *) No touchregion support as the statusbar doesn't have any action handling (it won't fail to parse though). *) Drawing stuff into the default VP is forbidden (loading images in it is not). You *need* to use viewports for the displaying stuff (parsing fails if no viewport is used). *) Themes that don't use a custom ui viewport can be fixed up using the new %Vi tag to avoid nasty redraw effectts (you must not draw into it as well, it's used to fix up the ui viewport). %Vi describes the viewport that the lists can use without getting in the way of the statusbar. Otherwise, it behaves like the classic statusbar, it can be configured in the theme settings, and can be turned off in the wps using %wd. Note to translaters: When translating LANG_STATUSBAR_CUSTOM, please consider using the same translation as for LANG_CHANNEL_CUSTOM if it's compatible. They could be combined later then. Flyspray: FS#10566 Author: myself git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23258 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 6cbd559f94..f0d3d31b30 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -71,6 +71,7 @@
71#include "wps.h" 71#include "wps.h"
72#include "skin_engine/skin_engine.h" 72#include "skin_engine/skin_engine.h"
73#include "viewport.h" 73#include "viewport.h"
74#include "statusbar-skinned.h"
74 75
75#if CONFIG_CODEC == MAS3507D 76#if CONFIG_CODEC == MAS3507D
76void dac_line_in(bool enable); 77void dac_line_in(bool enable);
@@ -740,6 +741,19 @@ void settings_apply_skins(void)
740 char buf[MAX_PATH]; 741 char buf[MAX_PATH];
741 /* re-initialize the skin buffer before we start reloading skins */ 742 /* re-initialize the skin buffer before we start reloading skins */
742 skin_buffer_init(); 743 skin_buffer_init();
744#ifdef HAVE_LCD_BITMAP
745 if ( global_settings.sbs_file[0] &&
746 global_settings.sbs_file[0] != 0xff )
747 {
748 snprintf(buf, sizeof buf, WPS_DIR "/%s.sbs",
749 global_settings.sbs_file);
750 sb_skin_data_load(SCREEN_MAIN, buf, true);
751 }
752 else
753 {
754 sb_skin_data_load(SCREEN_MAIN, NULL, true);
755 }
756#endif
743 if ( global_settings.wps_file[0] && 757 if ( global_settings.wps_file[0] &&
744 global_settings.wps_file[0] != 0xff ) 758 global_settings.wps_file[0] != 0xff )
745 { 759 {
@@ -752,6 +766,16 @@ void settings_apply_skins(void)
752 wps_data_load(SCREEN_MAIN, NULL, true); 766 wps_data_load(SCREEN_MAIN, NULL, true);
753 } 767 }
754#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1) 768#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
769 if ( global_settings.rsbs_file[0] &&
770 global_settings.rsbs_file[0] != 0xff ) {
771 snprintf(buf, sizeof buf, WPS_DIR "/%s.rsbs",
772 global_settings.rsbs_file);
773 sb_skin_data_load(SCREEN_REMOTE, buf, true);
774 }
775 else
776 {
777 sb_skin_data_load(SCREEN_REMOTE, NULL, true);
778 }
755 if ( global_settings.rwps_file[0]) 779 if ( global_settings.rwps_file[0])
756 { 780 {
757 snprintf(buf, sizeof buf, WPS_DIR "/%s.rwps", 781 snprintf(buf, sizeof buf, WPS_DIR "/%s.rwps",
@@ -763,6 +787,7 @@ void settings_apply_skins(void)
763 wps_data_load(SCREEN_REMOTE, NULL, true); 787 wps_data_load(SCREEN_REMOTE, NULL, true);
764 } 788 }
765#endif 789#endif
790 viewportmanager_theme_changed(THEME_STATUSBAR);
766} 791}
767 792
768void settings_apply(bool read_disk) 793void settings_apply(bool read_disk)
@@ -997,7 +1022,10 @@ void settings_apply(bool read_disk)
997#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 1022#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
998 enc_global_settings_apply(); 1023 enc_global_settings_apply();
999#endif 1024#endif
1000 viewportmanager_theme_changed(THEME_ALL); 1025#ifdef HAVE_LCD_BITMAP
1026 /* already called with THEME_STATUSBAR in settings_apply_skins() */
1027 viewportmanager_theme_changed(THEME_UI_VIEWPORT|THEME_LANGUAGE);
1028#endif
1001} 1029}
1002 1030
1003 1031