From 3e84d62a8c258153a49460916e6e6d3eb2dfc745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Fri, 30 Nov 2012 19:48:02 -0500 Subject: [PATCH] Marked current month in GcalYearView Added docs about it. --- doc/Views | 2 ++ src/gcal-year-view.c | 27 ++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/doc/Views b/doc/Views index 551fedf8..de1f3141 100644 --- a/doc/Views +++ b/doc/Views @@ -8,6 +8,8 @@ Here, I'll place some notes about views should be marked as is_date views - For marking current unit: + View will draw with selected_color the font of the current unit, so: + December, 14, or the hour (in day view) will be drawn in a different color. View will provide a two pixels mark for the current unit in every view. So: week-view will mark the day of week of the current date, no matters diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c index 91230cec..0b0e84e1 100644 --- a/src/gcal-year-view.c +++ b/src/gcal-year-view.c @@ -1031,11 +1031,6 @@ gcal_year_view_draw_grid (GcalYearView *view, gtk_style_context_restore (context); - cairo_set_source_rgb (cr, - ligther_color.red, - ligther_color.green, - ligther_color.blue); - /* drawing new-event mark */ if (priv->start_mark_cell != -1 && priv->end_mark_cell != -1) @@ -1092,11 +1087,24 @@ gcal_year_view_draw_grid (GcalYearView *view, cairo_restore (cr); } + cairo_set_source_rgb (cr, + ligther_color.red, + ligther_color.green, + ligther_color.blue); + /* drawing grid text */ for (i = 0; i < 2; i++) { for (j = 0; j < 6; j++) { + if (priv->date->month == i * 6 + j + 1) + { + cairo_set_source_rgb (cr, + selected_color.red, + selected_color.green, + selected_color.blue); + } + pango_layout_set_text (layout, gcal_get_month_name (i * 6 + j), -1); pango_cairo_update_layout (cr, layout); pango_layout_get_pixel_size (layout, &font_width, &font_height); @@ -1105,6 +1113,15 @@ gcal_year_view_draw_grid (GcalYearView *view, (alloc->width / 6) * j + header_padding.left, start_grid_y + padding->top + i * (alloc->height - start_grid_y) / 2); pango_cairo_show_layout (cr, layout); + + if (priv->date->month == i * 6 + j + 1) + { + cairo_set_source_rgb (cr, + ligther_color.red, + ligther_color.green, + ligther_color.blue); + + } } } /* free the layout object */