mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
plugins: clock: adjust defaults, don't restore color
- Default to round border in analog mode - Default to segmented LCD style in digital and binary mode - Default to date format most fitting for current language (instead of D-M-Y) - Don't forcibly set a light background before menu is displayed or when quitting - Update manual Change-Id: Ifb6a41bb99701ae8f8cbf5fa0db2a3a332085f43
This commit is contained in:
parent
8d4efb6cf2
commit
91c724dc19
4 changed files with 63 additions and 92 deletions
|
@ -65,7 +65,6 @@ const struct button_mapping* plugin_contexts[]={
|
|||
*************************/
|
||||
static void cleanup(void)
|
||||
{
|
||||
clock_draw_restore_colors();
|
||||
if(clock_settings.general.save_settings == 1)
|
||||
save_settings();
|
||||
|
||||
|
@ -181,7 +180,6 @@ enum plugin_status plugin_start(const void* parameter){
|
|||
break;
|
||||
#endif
|
||||
case ACTION_MENU:
|
||||
clock_draw_restore_colors();
|
||||
FOR_NB_SCREENS(i)
|
||||
rb->viewportmanager_theme_enable(i, true, NULL);
|
||||
exit_clock=main_menu();
|
||||
|
@ -198,7 +196,8 @@ enum plugin_status plugin_start(const void* parameter){
|
|||
break;
|
||||
}
|
||||
|
||||
if(redraw){
|
||||
if (redraw && !exit_clock)
|
||||
{
|
||||
clock_draw_set_colors();
|
||||
FOR_NB_SCREENS(i)
|
||||
clock_draw(rb->screens[i], &time, &counter);
|
||||
|
|
|
@ -64,11 +64,6 @@ static void skin_set_background(struct screen* display, int mode, int skin){
|
|||
white_background(display);
|
||||
}
|
||||
|
||||
static void skin_restore_background(struct screen* display, int mode, int skin){
|
||||
if(skin_require_black_background(mode, skin) )
|
||||
white_background(display);
|
||||
}
|
||||
|
||||
void clock_draw_set_colors(void){
|
||||
FOR_NB_SCREENS(i)
|
||||
skin_set_background(rb->screens[i],
|
||||
|
@ -76,15 +71,6 @@ void clock_draw_set_colors(void){
|
|||
clock_settings.skin[clock_settings.mode]);
|
||||
}
|
||||
|
||||
void clock_draw_restore_colors(void){
|
||||
FOR_NB_SCREENS(i){
|
||||
skin_restore_background(rb->screens[i],
|
||||
clock_settings.mode,
|
||||
clock_settings.skin[clock_settings.mode]);
|
||||
rb->screens[i]->update();
|
||||
}
|
||||
}
|
||||
|
||||
void clock_draw(struct screen* display, struct time* time,
|
||||
struct counter* counter){
|
||||
if(!show_counter)
|
||||
|
|
|
@ -58,11 +58,25 @@ static bool settings_needs_saving(struct clock_settings* settings){
|
|||
|
||||
void clock_settings_reset(struct clock_settings* settings){
|
||||
settings->mode = ANALOG;
|
||||
int i;
|
||||
for(i=0;i<NB_CLOCK_MODES;i++){
|
||||
settings->skin[i]=0;
|
||||
}
|
||||
settings->general.date_format = EUROPEAN;
|
||||
settings->skin[ANALOG] = 1; /* round */
|
||||
settings->skin[DIGITAL] = 1; /* LCD-style */
|
||||
settings->skin[BINARY] = 2; /* LCD-style */
|
||||
for (const char *ptr = rb->str(LANG_VOICED_DATE_FORMAT) ; *ptr; ptr++)
|
||||
{
|
||||
if (*ptr == 'd')
|
||||
break;
|
||||
else if (*ptr == 'Y')
|
||||
{
|
||||
settings->general.date_format = JAPANESE;
|
||||
break;
|
||||
}
|
||||
else if (*ptr == 'A' || *ptr == 'm')
|
||||
{
|
||||
settings->general.date_format = ENGLISH;
|
||||
break;
|
||||
}
|
||||
}
|
||||
settings->general.save_settings = true;
|
||||
settings->general.idle_poweroff=true;
|
||||
settings->general.backlight = ROCKBOX_SETTING;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue