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 | |
parent | 75e2f19de334bcbfa9d15062674d8efcb0eb2a64 (diff) | |
download | rockbox-14d276121af7aa458553f49500c802c87f23bd69.tar.gz rockbox-14d276121af7aa458553f49500c802c87f23bd69.zip |
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
-rw-r--r-- | apps/plugins/clock/clock.c | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_analog.c | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_binary.c | 6 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_digital.c | 19 |
4 files changed, 16 insertions, 13 deletions
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c index d80f6dca03..e9985a13ab 100644 --- a/apps/plugins/clock/clock.c +++ b/apps/plugins/clock/clock.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id: clock.c 14095 2007-07-31 10:53:53Z nls $ | 8 | * $Id: clock.c 14095 2007-07-31 10:53:53Z nls $ |
9 | * | 9 | * |
10 | * Copyright (C) 2007 Kévin Ferrare | 10 | * Copyright (C) 2007 Kévin Ferrare, graphic design 2003 Zakk Roberts |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
diff --git a/apps/plugins/clock/clock_draw_analog.c b/apps/plugins/clock/clock_draw_analog.c index 3cfb236db2..04d6c5a06e 100644 --- a/apps/plugins/clock/clock_draw_analog.c +++ b/apps/plugins/clock/clock_draw_analog.c | |||
@@ -193,7 +193,7 @@ void draw_hour(struct screen* display, struct time* time, | |||
193 | if(display->is_color){ | 193 | if(display->is_color){ |
194 | display->set_foreground(LCD_RGBPACK(100,110,125)); | 194 | display->set_foreground(LCD_RGBPACK(100,110,125)); |
195 | draw_hands(display, hour, time->minute, time->second, | 195 | draw_hands(display, hour, time->minute, time->second, |
196 | 2, skin, show_seconds); | 196 | 1, skin, show_seconds); |
197 | display->set_foreground(LCD_BLACK); | 197 | display->set_foreground(LCD_BLACK); |
198 | } | 198 | } |
199 | #endif | 199 | #endif |
diff --git a/apps/plugins/clock/clock_draw_binary.c b/apps/plugins/clock/clock_draw_binary.c index 5bc84f1583..b92118d9ce 100644 --- a/apps/plugins/clock/clock_draw_binary.c +++ b/apps/plugins/clock/clock_draw_binary.c | |||
@@ -43,9 +43,11 @@ void binary_clock_draw(struct screen* display, struct time* time, int skin){ | |||
43 | char buffer[9]; | 43 | char buffer[9]; |
44 | int i; | 44 | int i; |
45 | const struct picture* binary_bitmaps = &(binary_skin[skin][display->screen_type]); | 45 | const struct picture* binary_bitmaps = &(binary_skin[skin][display->screen_type]); |
46 | int y_offset=(display->height-(binary_bitmaps->height*3))/2; | ||
47 | int x_offset=(display->width-(binary_bitmaps->width*6))/2; | ||
46 | for(i=0;i<3;i++){ | 48 | for(i=0;i<3;i++){ |
47 | print_binary(buffer, lines_values[i], 6); | 49 | print_binary(buffer, lines_values[i], 6); |
48 | draw_string(display, binary_bitmaps, buffer, 0, | 50 | draw_string(display, binary_bitmaps, buffer, x_offset, |
49 | binary_bitmaps->height*i); | 51 | binary_bitmaps->height*i+y_offset); |
50 | } | 52 | } |
51 | } | 53 | } |
diff --git a/apps/plugins/clock/clock_draw_digital.c b/apps/plugins/clock/clock_draw_digital.c index 9fff47c520..07864c1cec 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, | |||
48 | else | 48 | else |
49 | display_colon=true; | 49 | display_colon=true; |
50 | 50 | ||
51 | if(settings->general.hour_format==H12){/* AM/PM format */ | 51 | if(settings->general.hour_format==H12 && time->hour>12)/* AM/PM format */ |
52 | if(hour>12){ | 52 | hour -= 12; |
53 | buffer_printf(buffer, buffer_pos, "P");/* AM */ | 53 | |
54 | /* readjust the hour to 12-hour format | ||
55 | * ( 13:00+ -> 1:00+ ) */ | ||
56 | hour -= 12; | ||
57 | }else | ||
58 | buffer_printf(buffer, buffer_pos, "A");/* AM */ | ||
59 | } | ||
60 | buffer_printf(buffer, buffer_pos, "%02d", hour); | 54 | buffer_printf(buffer, buffer_pos, "%02d", hour); |
61 | buffer_printf(buffer, buffer_pos, "%c", display_colon?':':' '); | 55 | buffer_printf(buffer, buffer_pos, "%c", display_colon?':':' '); |
62 | buffer_printf(buffer, buffer_pos, "%02d", time->minute); | 56 | buffer_printf(buffer, buffer_pos, "%02d", time->minute); |
57 | if(settings->general.hour_format==H12){ | ||
58 | if(time->hour>12){ | ||
59 | buffer_printf(buffer, buffer_pos, "P");/* PM */ | ||
60 | }else{ | ||
61 | buffer_printf(buffer, buffer_pos, "A");/* AM */ | ||
62 | } | ||
63 | } | ||
63 | getstringsize(digits_bitmaps, buffer, &str_w, &str_h); | 64 | getstringsize(digits_bitmaps, buffer, &str_w, &str_h); |
64 | draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2, 0); | 65 | draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2, 0); |
65 | if(settings->digital.show_seconds){ | 66 | if(settings->digital.show_seconds){ |