summaryrefslogtreecommitdiff
path: root/apps/plugins/clock
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/clock')
-rw-r--r--apps/plugins/clock/clock.c2
-rw-r--r--apps/plugins/clock/clock_draw_analog.c2
-rw-r--r--apps/plugins/clock/clock_draw_binary.c6
-rw-r--r--apps/plugins/clock/clock_draw_digital.c19
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 @@
* \/ \/ \/ \/ \/
* $Id: clock.c 14095 2007-07-31 10:53:53Z nls $
*
- * Copyright (C) 2007 Kévin Ferrare
+ * Copyright (C) 2007 Kévin Ferrare, graphic design 2003 Zakk Roberts
*
* All files in this archive are subject to the GNU General Public License.
* 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,
if(display->is_color){
display->set_foreground(LCD_RGBPACK(100,110,125));
draw_hands(display, hour, time->minute, time->second,
- 2, skin, show_seconds);
+ 1, skin, show_seconds);
display->set_foreground(LCD_BLACK);
}
#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){
char buffer[9];
int i;
const struct picture* binary_bitmaps = &(binary_skin[skin][display->screen_type]);
+ int y_offset=(display->height-(binary_bitmaps->height*3))/2;
+ int x_offset=(display->width-(binary_bitmaps->width*6))/2;
for(i=0;i<3;i++){
print_binary(buffer, lines_values[i], 6);
- draw_string(display, binary_bitmaps, buffer, 0,
- binary_bitmaps->height*i);
+ draw_string(display, binary_bitmaps, buffer, x_offset,
+ binary_bitmaps->height*i+y_offset);
}
}
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,
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){