forked from len0rd/rockbox
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
This commit is contained in:
parent
75e2f19de3
commit
14d276121a
4 changed files with 16 additions and 13 deletions
|
@ -7,7 +7,7 @@
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
* $Id: clock.c 14095 2007-07-31 10:53:53Z nls $
|
* $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.
|
* 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.
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
|
|
|
@ -193,7 +193,7 @@ void draw_hour(struct screen* display, struct time* time,
|
||||||
if(display->is_color){
|
if(display->is_color){
|
||||||
display->set_foreground(LCD_RGBPACK(100,110,125));
|
display->set_foreground(LCD_RGBPACK(100,110,125));
|
||||||
draw_hands(display, hour, time->minute, time->second,
|
draw_hands(display, hour, time->minute, time->second,
|
||||||
2, skin, show_seconds);
|
1, skin, show_seconds);
|
||||||
display->set_foreground(LCD_BLACK);
|
display->set_foreground(LCD_BLACK);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -43,9 +43,11 @@ void binary_clock_draw(struct screen* display, struct time* time, int skin){
|
||||||
char buffer[9];
|
char buffer[9];
|
||||||
int i;
|
int i;
|
||||||
const struct picture* binary_bitmaps = &(binary_skin[skin][display->screen_type]);
|
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++){
|
for(i=0;i<3;i++){
|
||||||
print_binary(buffer, lines_values[i], 6);
|
print_binary(buffer, lines_values[i], 6);
|
||||||
draw_string(display, binary_bitmaps, buffer, 0,
|
draw_string(display, binary_bitmaps, buffer, x_offset,
|
||||||
binary_bitmaps->height*i);
|
binary_bitmaps->height*i+y_offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,18 +48,19 @@ void digital_clock_draw(struct screen* display,
|
||||||
else
|
else
|
||||||
display_colon=true;
|
display_colon=true;
|
||||||
|
|
||||||
if(settings->general.hour_format==H12){/* AM/PM format */
|
if(settings->general.hour_format==H12 && time->hour>12)/* 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;
|
hour -= 12;
|
||||||
}else
|
|
||||||
buffer_printf(buffer, buffer_pos, "A");/* AM */
|
|
||||||
}
|
|
||||||
buffer_printf(buffer, buffer_pos, "%02d", hour);
|
buffer_printf(buffer, buffer_pos, "%02d", hour);
|
||||||
buffer_printf(buffer, buffer_pos, "%c", display_colon?':':' ');
|
buffer_printf(buffer, buffer_pos, "%c", display_colon?':':' ');
|
||||||
buffer_printf(buffer, buffer_pos, "%02d", time->minute);
|
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);
|
getstringsize(digits_bitmaps, buffer, &str_w, &str_h);
|
||||||
draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2, 0);
|
draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2, 0);
|
||||||
if(settings->digital.show_seconds){
|
if(settings->digital.show_seconds){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue