X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclock%2Fclock.c;h=73547d155dc21318c1a458d16e167eef05f8e1c5;hb=d753ad772192bbcaa656c172b0405f7be2de7b24;hp=500cfa3ba8556f82a8e30ac0afe688caa861c5b2;hpb=fc22af941cf7b9db65a703e9e697490119c70ec2;p=chaz%2Ftint2 diff --git a/src/clock/clock.c b/src/clock/clock.c index 500cfa3..73547d1 100644 --- a/src/clock/clock.c +++ b/src/clock/clock.c @@ -2,7 +2,7 @@ * * Tint2 : clock * -* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) +* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 @@ -43,9 +43,9 @@ char *clock_rclick_command; struct timeval time_clock; PangoFontDescription *time1_font_desc; PangoFontDescription *time2_font_desc; -static char buf_time[40]; -static char buf_date[40]; -static char buf_tooltip[40]; +static char buf_time[256]; +static char buf_date[256]; +static char buf_tooltip[512]; int clock_enabled; static timeout* clock_timeout; @@ -143,7 +143,9 @@ void init_clock_panel(void *p) { Panel *panel =(Panel*)p; Clock *clock = &panel->clock; - + + if (clock->area.bg == 0) + clock->area.bg = &g_array_index(backgrounds, Background, 0); clock->area.parent = p; clock->area.panel = p; clock->area._draw_foreground = draw_clock; @@ -221,8 +223,8 @@ int resize_clock (void *obj) clock->area.width = new_size + 1; clock->time1_posy = (clock->area.height - time_height) / 2; if (time2_format) { - clock->time1_posy -= ((date_height_ink + 2) / 2); - clock->time2_posy = clock->time1_posy + time_height + 2 - (time_height - time_height_ink)/2 - (date_height - date_height_ink)/2; + clock->time1_posy -= (date_height)/2; + clock->time2_posy = clock->time1_posy + time_height; } ret = 1; } @@ -234,8 +236,8 @@ int resize_clock (void *obj) clock->area.height = new_size; clock->time1_posy = (clock->area.height - time_height) / 2; if (time2_format) { - clock->time1_posy -= ((date_height_ink + 2) / 2); - clock->time2_posy = clock->time1_posy + time_height + 2 - (time_height - time_height_ink)/2 - (date_height - date_height_ink)/2; + clock->time1_posy -= (date_height)/2; + clock->time2_posy = clock->time1_posy + time_height; } ret = 1; }