Marked current month in GcalYearView
Added docs about it.
This commit is contained in:
committed by
Rene A. Viant Moran
parent
8b6f11d743
commit
3e84d62a8c
@@ -8,6 +8,8 @@ Here, I'll place some notes about views
|
|||||||
should be marked as is_date views
|
should be marked as is_date views
|
||||||
|
|
||||||
- For marking current unit:
|
- 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.
|
View will provide a two pixels mark for the current unit in every view.
|
||||||
So:
|
So:
|
||||||
week-view will mark the day of week of the current date, no matters
|
week-view will mark the day of week of the current date, no matters
|
||||||
|
|||||||
+22
-5
@@ -1031,11 +1031,6 @@ gcal_year_view_draw_grid (GcalYearView *view,
|
|||||||
|
|
||||||
gtk_style_context_restore (context);
|
gtk_style_context_restore (context);
|
||||||
|
|
||||||
cairo_set_source_rgb (cr,
|
|
||||||
ligther_color.red,
|
|
||||||
ligther_color.green,
|
|
||||||
ligther_color.blue);
|
|
||||||
|
|
||||||
/* drawing new-event mark */
|
/* drawing new-event mark */
|
||||||
if (priv->start_mark_cell != -1 &&
|
if (priv->start_mark_cell != -1 &&
|
||||||
priv->end_mark_cell != -1)
|
priv->end_mark_cell != -1)
|
||||||
@@ -1092,11 +1087,24 @@ gcal_year_view_draw_grid (GcalYearView *view,
|
|||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo_set_source_rgb (cr,
|
||||||
|
ligther_color.red,
|
||||||
|
ligther_color.green,
|
||||||
|
ligther_color.blue);
|
||||||
|
|
||||||
/* drawing grid text */
|
/* drawing grid text */
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 6; j++)
|
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_layout_set_text (layout, gcal_get_month_name (i * 6 + j), -1);
|
||||||
pango_cairo_update_layout (cr, layout);
|
pango_cairo_update_layout (cr, layout);
|
||||||
pango_layout_get_pixel_size (layout, &font_width, &font_height);
|
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,
|
(alloc->width / 6) * j + header_padding.left,
|
||||||
start_grid_y + padding->top + i * (alloc->height - start_grid_y) / 2);
|
start_grid_y + padding->top + i * (alloc->height - start_grid_y) / 2);
|
||||||
pango_cairo_show_layout (cr, layout);
|
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 */
|
/* free the layout object */
|
||||||
|
|||||||
Reference in New Issue
Block a user