From 8d9e88013e52ccddb730352d984e764d1914c2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Thu, 4 Jul 2013 14:08:41 -0400 Subject: [PATCH] gcal-year-view: refactored draw new-event marks Make it more readable. --- src/gcal-year-view.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c index 5357e2b5..52716d42 100644 --- a/src/gcal-year-view.c +++ b/src/gcal-year-view.c @@ -788,30 +788,20 @@ gcal_year_view_draw_grid (GcalYearView *view, background_selected_color.blue, background_selected_color.alpha); - for (rows = 0; rows < (last_cell / 6) - (first_cell / 6) + 1; rows++) + for (rows = 0; rows < last_cell / 6 - first_cell / 6 + 1; rows++) { gint first_point; gint last_point; first_point = (rows == 0) ? first_cell : ((first_cell / 6) + rows) * 6; - cairo_move_to ( - cr, - (alloc->width / 6) * ( first_point % 6), - (alloc->height / 2) * ( first_point / 6) + 1); - last_point = (rows == (last_cell / 6 - first_cell / 6)) ? last_cell : ((first_cell / 6) + rows) * 6 + 5; - cairo_rel_line_to (cr, - (alloc->width / 6) * (last_point - first_point + 1), - 0); - cairo_rel_line_to (cr, - 0, - alloc->height / 2); - cairo_rel_line_to (cr, - - (alloc->width / 6) * (last_point - first_point + 1), - 0); - cairo_rel_line_to (cr, - 0, - - alloc->height / 2); + + cairo_rectangle (cr, + (alloc->width / 6) * ( first_point % 6), + (alloc->height / 2) * ( first_point / 6) + 1, + (alloc->width / 6) * (last_point - first_point + 1), + alloc->height / 2); + cairo_fill (cr); } @@ -940,6 +930,7 @@ gcal_year_view_get_final_date (GcalView *view) return new_date; } + static void gcal_year_view_mark_current_unit (GcalView *view, gint *x,