Fix issue 401: Seconds not updating in second line of clock
git-svn-id: http://tint2.googlecode.com/svn/trunk@683 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
1272ce4bb9
commit
3f42584fbd
1 changed files with 13 additions and 3 deletions
|
@ -127,14 +127,24 @@ const char* clock_get_tooltip(void* obj)
|
|||
return buf_tooltip;
|
||||
}
|
||||
|
||||
int time_format_needs_sec_ticks(char *time_format)
|
||||
{
|
||||
if (!time_format)
|
||||
return 0;
|
||||
if (strchr(time_format, 'S') || strchr(time_format, 'T') || strchr(time_format, 'r'))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void init_clock()
|
||||
{
|
||||
if(time1_format && clock_timeout==0) {
|
||||
if (strchr(time1_format, 'S') || strchr(time1_format, 'T') || strchr(time1_format, 'r'))
|
||||
if (clock_timeout == 0) {
|
||||
if (time_format_needs_sec_ticks(time1_format) ||
|
||||
time_format_needs_sec_ticks(time2_format)) {
|
||||
clock_timeout = add_timeout(10, 1000, update_clocks_sec, 0);
|
||||
else
|
||||
} else {
|
||||
clock_timeout = add_timeout(10, 1000, update_clocks_min, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue