-
- if (panel_horizontal) {
- // panel horizonal => fixed height and posy
- clock->area.posy = panel->area.pix.border.width + panel->area.paddingy;
- clock->area.height = panel->area.height - (2 * clock->area.posy);
- }
- else {
- // panel vertical => fixed width, height, posy and posx
- clock->area.posy = panel->area.pix.border.width + panel->area.paddingxlr;
- clock->area.height = (2 * clock->area.paddingxlr) + (time_height + date_height);
- clock->area.posx = panel->area.pix.border.width + panel->area.paddingy;
- clock->area.width = panel->area.width - (2 * panel->area.pix.border.width) - (2 * panel->area.paddingy);
- }
-
- clock->time1_posy = (clock->area.height - time_height) / 2;
- if (time2_format) {
- strftime(buf_date, sizeof(buf_date), time2_format, localtime(&time_clock.tv_sec));
- get_text_size(time2_font_desc, &date_height_ink, &date_height, panel->area.height, buf_date, strlen(buf_date));
-
- 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;
- }
-}
-
-
-void cleanup_clock()
-{
- clock_enabled = 0;
- if (time1_font_desc)
- pango_font_description_free(time1_font_desc);
- if (time2_font_desc)
- pango_font_description_free(time2_font_desc);
- if (time1_format)
- g_free(time1_format);
- if (time2_format)
- g_free(time2_format);
- if (clock_lclick_command)
- g_free(clock_lclick_command);
- if (clock_rclick_command)
- g_free(clock_rclick_command);
- time1_font_desc = time2_font_desc = 0;
- time1_format = time2_format = 0;
- clock_lclick_command = clock_rclick_command = 0;