diff options
| author | Kevin Ferrare <kevin@rockbox.org> | 2007-08-04 14:50:28 +0000 |
|---|---|---|
| committer | Kevin Ferrare <kevin@rockbox.org> | 2007-08-04 14:50:28 +0000 |
| commit | 14d276121af7aa458553f49500c802c87f23bd69 (patch) | |
| tree | 41a86c0bce9379f96c23900fc91c82d037766bde /apps/plugins/clock/clock_draw_digital.c | |
| parent | 75e2f19de334bcbfa9d15062674d8efcb0eb2a64 (diff) | |
| download | rockbox-14d276121af7aa458553f49500c802c87f23bd69.zip rockbox-14d276121af7aa458553f49500c802c87f23bd69.tar.gz rockbox-14d276121af7aa458553f49500c802c87f23bd69.tar.bz2 rockbox-14d276121af7aa458553f49500c802c87f23bd69.tar.xz | |
Clock plugin : centered the binary plugin, moved the AM/PM mark to the right on digital display, reduced the thickness of the pseudo antialiasing for analog clock
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14181 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/clock/clock_draw_digital.c')
| -rw-r--r-- | apps/plugins/clock/clock_draw_digital.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/plugins/clock/clock_draw_digital.c b/apps/plugins/clock/clock_draw_digital.c index 9fff47c..07864c1 100644 --- a/apps/plugins/clock/clock_draw_digital.c +++ b/apps/plugins/clock/clock_draw_digital.c @@ -48,18 +48,19 @@ void digital_clock_draw(struct screen* display, else display_colon=true; - if(settings->general.hour_format==H12){/* AM/PM format */ - if(hour>12){ - buffer_printf(buffer, buffer_pos, "P");/* AM */ - /* readjust the hour to 12-hour format - * ( 13:00+ -> 1:00+ ) */ - hour -= 12; - }else - buffer_printf(buffer, buffer_pos, "A");/* AM */ - } + if(settings->general.hour_format==H12 && time->hour>12)/* AM/PM format */ + hour -= 12; + buffer_printf(buffer, buffer_pos, "%02d", hour); buffer_printf(buffer, buffer_pos, "%c", display_colon?':':' '); buffer_printf(buffer, buffer_pos, "%02d", time->minute); + if(settings->general.hour_format==H12){ + if(time->hour>12){ + buffer_printf(buffer, buffer_pos, "P");/* PM */ + }else{ + buffer_printf(buffer, buffer_pos, "A");/* AM */ + } + } getstringsize(digits_bitmaps, buffer, &str_w, &str_h); draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2, 0); if(settings->digital.show_seconds){ |