Added actua date mark to implemented views.
Following mockups by Reda Lazri, the actual day it's marked by drawing a box around the weekday and a 2px line on the cell belonging to the actual date. Added icon to gnome-calendar.desktop. Tweaked css a little bit.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
_Name=Calendar
|
_Name=Calendar
|
||||||
_Comment=Access, and manage calendar
|
_Comment=Access, and manage calendar
|
||||||
Exec=gnome-calendar
|
Exec=gnome-calendar
|
||||||
Icon=calendr
|
Icon=x-office-calendar
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
|
|||||||
+15
-5
@@ -45,10 +45,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.calendar-view:selected {
|
.calendar-view:selected {
|
||||||
background-color: #555753;
|
color: #0C73E5;
|
||||||
|
font: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.event {
|
.event {
|
||||||
|
border-radius: 0;
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
padding-bottom: 3px;
|
padding-bottom: 3px;
|
||||||
@@ -60,15 +62,23 @@
|
|||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: @borders;
|
border-color: @borders;
|
||||||
border-width: 0.5px;
|
border-width: 0.5px;
|
||||||
border-radius: 3px;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: not working */
|
.entry {
|
||||||
.event-details .view {
|
border-radius: 0;
|
||||||
box-shadow: 40px 40px black;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkClutterOffscreen.overlay {
|
GtkClutterOffscreen.overlay {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GtkClutterOffscreen.overlay .frame {
|
||||||
|
padding: 12px;
|
||||||
|
margin: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
GtkClutterOffscreen.overlay .frame * {
|
||||||
|
color: @theme_fg_color;
|
||||||
|
}
|
||||||
|
|||||||
+84
-31
@@ -389,7 +389,7 @@ gcal_month_view_size_allocate (GtkWidget *widget,
|
|||||||
pango_layout_get_pixel_size (layout, NULL, &font_height);
|
pango_layout_get_pixel_size (layout, NULL, &font_height);
|
||||||
|
|
||||||
/* 6: is padding around the header */
|
/* 6: is padding around the header */
|
||||||
priv->header_size = font_height + 6;
|
priv->header_size = font_height + 12;
|
||||||
gtk_style_context_remove_region (context, "header");
|
gtk_style_context_remove_region (context, "header");
|
||||||
gtk_style_context_restore (context);
|
gtk_style_context_restore (context);
|
||||||
|
|
||||||
@@ -799,10 +799,11 @@ gcal_month_view_draw_grid (GcalMonthView *view,
|
|||||||
GtkStyleContext *context;
|
GtkStyleContext *context;
|
||||||
GtkStateFlags state;
|
GtkStateFlags state;
|
||||||
GdkRGBA color;
|
GdkRGBA color;
|
||||||
|
GdkRGBA selected_color;
|
||||||
|
|
||||||
gint i, j;
|
gint i, j;
|
||||||
gint font_width;
|
gint font_width;
|
||||||
gint font_height;
|
gint max_day_width;
|
||||||
|
|
||||||
gdouble start_grid_x;
|
gdouble start_grid_x;
|
||||||
gdouble start_grid_y;
|
gdouble start_grid_y;
|
||||||
@@ -810,6 +811,9 @@ gcal_month_view_draw_grid (GcalMonthView *view,
|
|||||||
guint8 n_days_in_month;
|
guint8 n_days_in_month;
|
||||||
|
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
|
const PangoFontDescription *font;
|
||||||
|
const PangoFontDescription *selected_font;
|
||||||
|
|
||||||
gchar *day;
|
gchar *day;
|
||||||
|
|
||||||
priv = view->priv;
|
priv = view->priv;
|
||||||
@@ -820,81 +824,130 @@ gcal_month_view_draw_grid (GcalMonthView *view,
|
|||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
state = gtk_widget_get_state_flags (widget);
|
state = gtk_widget_get_state_flags (widget);
|
||||||
|
|
||||||
/* drawing selected_cell */
|
|
||||||
//FIXME: to draw date in the selected cell if it's not in the month
|
|
||||||
state |= GTK_STATE_FLAG_SELECTED;
|
state |= GTK_STATE_FLAG_SELECTED;
|
||||||
gtk_style_context_get_background_color (context, state, &color);
|
gtk_style_context_get_color (context, state, &selected_color);
|
||||||
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 0.6);
|
selected_font = gtk_style_context_get_font (context, state);
|
||||||
cairo_rectangle (cr,
|
|
||||||
start_grid_x + priv->horizontal_step * ( priv->selected_cell % 7),
|
|
||||||
start_grid_y + priv->vertical_step * ( priv->selected_cell / 7),
|
|
||||||
priv->horizontal_step,
|
|
||||||
priv->vertical_step);
|
|
||||||
cairo_fill (cr);
|
|
||||||
|
|
||||||
/* drawing grid */
|
|
||||||
state = gtk_widget_get_state_flags (widget);
|
state = gtk_widget_get_state_flags (widget);
|
||||||
gtk_style_context_get_color (context, state, &color);
|
gtk_style_context_get_color (context, state, &color);
|
||||||
|
font = gtk_style_context_get_font (context, state);
|
||||||
cairo_set_source_rgba (cr, color.red, color.green, color.blue, color.alpha);
|
cairo_set_source_rgba (cr, color.red, color.green, color.blue, color.alpha);
|
||||||
|
|
||||||
layout = pango_cairo_create_layout (cr);
|
layout = pango_cairo_create_layout (cr);
|
||||||
pango_layout_set_font_description (layout,
|
pango_layout_set_font_description (layout, font);
|
||||||
gtk_style_context_get_font (context,
|
|
||||||
state));
|
|
||||||
|
|
||||||
n_days_in_month = icaltime_days_in_month (priv->date->month,
|
n_days_in_month = icaltime_days_in_month (priv->date->month,
|
||||||
priv->date->year);
|
priv->date->year);
|
||||||
|
|
||||||
|
/* drawing grid text */
|
||||||
|
max_day_width = 0;
|
||||||
|
/* calculating maximus */
|
||||||
for (i = 0; i < 7; i++)
|
for (i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
pango_layout_set_text (layout, gcal_get_weekday (i), -1);
|
pango_layout_set_text (layout, gcal_get_weekday (i), -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, NULL);
|
||||||
|
|
||||||
|
max_day_width = max_day_width < font_width ? font_width : max_day_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 7; i++)
|
||||||
|
{
|
||||||
|
if (i == priv->selected_cell % 7)
|
||||||
|
{
|
||||||
|
cairo_set_source_rgba (cr, selected_color.red, selected_color.green, selected_color.blue, 1);
|
||||||
|
cairo_rectangle (cr,
|
||||||
|
start_grid_x + priv->horizontal_step * i,
|
||||||
|
start_grid_y - priv->grid_header_size - 6,
|
||||||
|
max_day_width + 12,
|
||||||
|
priv->grid_header_size + 6);
|
||||||
|
cairo_fill (cr);
|
||||||
|
|
||||||
|
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
pango_layout_set_text (layout, gcal_get_weekday (i), -1);
|
||||||
|
pango_cairo_update_layout (cr, layout);
|
||||||
|
pango_layout_get_pixel_size (layout, &font_width, NULL);
|
||||||
|
|
||||||
/* 6: is padding around the grid-header */
|
/* 6: is padding around the grid-header */
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
start_grid_x + priv->horizontal_step * i + 6,
|
start_grid_x + priv->horizontal_step * i + 6 + (gint) ( (max_day_width - font_width) / 2),
|
||||||
start_grid_y - priv->grid_header_size);
|
start_grid_y - priv->grid_header_size);
|
||||||
pango_cairo_show_layout (cr, layout);
|
pango_cairo_show_layout (cr, layout);
|
||||||
|
|
||||||
|
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 1);
|
||||||
|
|
||||||
for (j = 0; j < 5; j++)
|
for (j = 0; j < 5; j++)
|
||||||
{
|
{
|
||||||
gint n_day = j * 7 + i + priv->days_delay;
|
gint n_day;
|
||||||
if (n_day <= 0 ||
|
n_day = j * 7 + i + priv->days_delay;
|
||||||
n_day > n_days_in_month)
|
if (n_day <= 0 || n_day > n_days_in_month)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* drawing selected_day */
|
||||||
|
if (priv->selected_cell == n_day - 1)
|
||||||
|
{
|
||||||
|
cairo_set_source_rgba (cr, selected_color.red, selected_color.green, selected_color.blue, 1);
|
||||||
|
pango_layout_set_font_description ( layout, selected_font);
|
||||||
|
}
|
||||||
|
|
||||||
day = g_strdup_printf ("%d", n_day);
|
day = g_strdup_printf ("%d", n_day);
|
||||||
pango_layout_set_text (layout, day, -1);
|
pango_layout_set_text (layout, day, -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, NULL);
|
||||||
/* 2: is margin-left and 1: is margin_top for numbers */
|
/* 2: is margin-left and 1: is margin_top for numbers */
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
start_grid_x + priv->horizontal_step * i + 2,
|
start_grid_x + priv->horizontal_step * i + 2,
|
||||||
start_grid_y + priv->vertical_step * j + 1);
|
start_grid_y + priv->vertical_step * j + 1);
|
||||||
pango_cairo_show_layout (cr, layout);
|
pango_cairo_show_layout (cr, layout);
|
||||||
|
|
||||||
|
/* unsetting selected flag */
|
||||||
|
if (priv->selected_cell == n_day - 1)
|
||||||
|
{
|
||||||
|
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 1);
|
||||||
|
pango_layout_set_font_description ( layout, font);
|
||||||
|
}
|
||||||
g_free (day);
|
g_free (day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* free the layout object */
|
/* drawing grid skel */
|
||||||
g_object_unref (layout);
|
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 1);
|
||||||
|
cairo_set_line_width (cr, 1.5);
|
||||||
|
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
cairo_move_to (cr, start_grid_x, start_grid_y + priv->vertical_step * i);
|
cairo_move_to (cr, start_grid_x, start_grid_y + priv->vertical_step * i);
|
||||||
cairo_line_to (cr,
|
cairo_rel_line_to (cr, priv->horizontal_step * 7, 0);
|
||||||
start_grid_x + priv->horizontal_step * 7,
|
|
||||||
start_grid_y + priv->vertical_step * i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
cairo_move_to (cr, start_grid_x + priv->horizontal_step * i, start_grid_y);
|
cairo_move_to (cr, start_grid_x + priv->horizontal_step * i, start_grid_y);
|
||||||
cairo_line_to (cr,
|
cairo_rel_line_to (cr, 0, priv->vertical_step * 5);
|
||||||
start_grid_x + priv->horizontal_step * i,
|
|
||||||
start_grid_y + priv->vertical_step * 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
|
|
||||||
|
/* drawing selected_cell */
|
||||||
|
//FIXME: What to do when the selected date isn't on the in the month
|
||||||
|
cairo_set_source_rgba (cr, selected_color.red, selected_color.green, selected_color.blue, 1);
|
||||||
|
/* Tiny line behind weekday box */
|
||||||
|
cairo_move_to (cr,
|
||||||
|
start_grid_x + priv->horizontal_step * ( priv->selected_cell % 7),
|
||||||
|
start_grid_y);
|
||||||
|
cairo_rel_line_to (cr, max_day_width + 12, 0);
|
||||||
|
|
||||||
|
/* Two pixel line on the selected day cell */
|
||||||
|
cairo_set_line_width (cr, 2.0);
|
||||||
|
cairo_move_to (cr,
|
||||||
|
start_grid_x + priv->horizontal_step * ( priv->selected_cell % 7),
|
||||||
|
start_grid_y + priv->vertical_step * ( priv->selected_cell / 7));
|
||||||
|
cairo_rel_line_to (cr, priv->horizontal_step, 0);
|
||||||
|
cairo_stroke (cr);
|
||||||
|
|
||||||
|
/* free the layout object */
|
||||||
|
g_object_unref (layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GcalView Interface API */
|
/* GcalView Interface API */
|
||||||
|
|||||||
+78
-17
@@ -386,7 +386,7 @@ gcal_week_view_size_allocate (GtkWidget *widget,
|
|||||||
pango_layout_get_pixel_size (layout, NULL, &font_height);
|
pango_layout_get_pixel_size (layout, NULL, &font_height);
|
||||||
|
|
||||||
/* 6: is padding around the header */
|
/* 6: is padding around the header */
|
||||||
priv->header_size = font_height + 6;
|
priv->header_size = font_height + 12;
|
||||||
gtk_style_context_remove_region (context, "header");
|
gtk_style_context_remove_region (context, "header");
|
||||||
gtk_style_context_restore (context);
|
gtk_style_context_restore (context);
|
||||||
|
|
||||||
@@ -726,36 +726,88 @@ gcal_week_view_draw_grid (GcalWeekView *view,
|
|||||||
GtkStyleContext *context;
|
GtkStyleContext *context;
|
||||||
GtkStateFlags state;
|
GtkStateFlags state;
|
||||||
GdkRGBA color;
|
GdkRGBA color;
|
||||||
|
GdkRGBA selected_color;
|
||||||
|
|
||||||
gint i;
|
gint i;
|
||||||
gint font_width;
|
gint font_width;
|
||||||
gint font_height;
|
gint font_height;
|
||||||
|
|
||||||
|
gint max_day_width;
|
||||||
|
gint actual_day;
|
||||||
|
|
||||||
|
gdouble start_grid_x;
|
||||||
|
gdouble start_grid_y;
|
||||||
|
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
|
const PangoFontDescription *font;
|
||||||
|
|
||||||
icaltimetype *start_of_week;
|
icaltimetype *start_of_week;
|
||||||
|
|
||||||
priv = view->priv;
|
priv = view->priv;
|
||||||
widget = GTK_WIDGET (view);
|
widget = GTK_WIDGET (view);
|
||||||
|
|
||||||
|
start_grid_x = alloc->x + padding->left + priv->grid_sidebar_size;
|
||||||
|
start_grid_y = alloc->y + padding->top + priv->header_size + priv->grid_header_size;
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
state = gtk_widget_get_state_flags (widget);
|
state = gtk_widget_get_state_flags (widget);
|
||||||
|
state |= GTK_STATE_FLAG_SELECTED;
|
||||||
|
gtk_style_context_get_color (context, state, &selected_color);
|
||||||
|
|
||||||
/* drawing grid header */
|
|
||||||
state = gtk_widget_get_state_flags (widget);
|
state = gtk_widget_get_state_flags (widget);
|
||||||
gtk_style_context_get_color (context, state, &color);
|
gtk_style_context_get_color (context, state, &color);
|
||||||
|
font = gtk_style_context_get_font (context, state);
|
||||||
|
|
||||||
|
/* drawing grid header */
|
||||||
cairo_set_source_rgba (cr, color.red, color.green, color.blue, color.alpha);
|
cairo_set_source_rgba (cr, color.red, color.green, color.blue, color.alpha);
|
||||||
|
|
||||||
layout = pango_cairo_create_layout (cr);
|
layout = pango_cairo_create_layout (cr);
|
||||||
pango_layout_set_font_description (layout,
|
pango_layout_set_font_description (layout, font);
|
||||||
gtk_style_context_get_font (context,
|
|
||||||
state));
|
|
||||||
|
|
||||||
start_of_week = gcal_week_view_get_initial_date (GCAL_VIEW (view));
|
start_of_week = gcal_week_view_get_initial_date (GCAL_VIEW (view));
|
||||||
|
|
||||||
|
/* drawing grid text */
|
||||||
|
max_day_width = 0;
|
||||||
|
actual_day = icaltime_day_of_week (*(priv->date)) - 1;
|
||||||
|
/* calculating maximus */
|
||||||
for (i = 0; i < 7; i++)
|
for (i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
gchar *weekday_header;
|
gchar *weekday_header;
|
||||||
gint n_day;
|
gint n_day;
|
||||||
|
|
||||||
|
n_day = start_of_week->day + i;
|
||||||
|
if (n_day > icaltime_days_in_month (start_of_week->month, start_of_week->year))
|
||||||
|
n_day = n_day - icaltime_days_in_month (start_of_week->month, start_of_week->year);
|
||||||
|
|
||||||
|
weekday_header = g_strdup_printf ("%s %d",gcal_get_weekday (i), n_day);
|
||||||
|
pango_layout_set_text (layout, weekday_header, -1);
|
||||||
|
pango_cairo_update_layout (cr, layout);
|
||||||
|
pango_layout_get_pixel_size (layout, &font_width, &font_height);
|
||||||
|
|
||||||
|
max_day_width = max_day_width < font_width ? font_width : max_day_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 7; i++)
|
||||||
|
{
|
||||||
|
gchar *weekday_header;
|
||||||
|
gint n_day;
|
||||||
|
|
||||||
|
if (i == actual_day)
|
||||||
|
{
|
||||||
|
cairo_set_source_rgba (cr, selected_color.red, selected_color.green, selected_color.blue, 1);
|
||||||
|
cairo_rectangle (cr,
|
||||||
|
start_grid_x + priv->horizontal_step * i,
|
||||||
|
start_grid_y - priv->grid_header_size - 6,
|
||||||
|
max_day_width + 12,
|
||||||
|
priv->grid_header_size + 6);
|
||||||
|
cairo_fill (cr);
|
||||||
|
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 1);
|
||||||
|
}
|
||||||
|
|
||||||
n_day = start_of_week->day + i;
|
n_day = start_of_week->day + i;
|
||||||
if (n_day > icaltime_days_in_month (start_of_week->month, start_of_week->year))
|
if (n_day > icaltime_days_in_month (start_of_week->month, start_of_week->year))
|
||||||
n_day = n_day - icaltime_days_in_month (start_of_week->month, start_of_week->year);
|
n_day = n_day - icaltime_days_in_month (start_of_week->month, start_of_week->year);
|
||||||
@@ -765,8 +817,8 @@ gcal_week_view_draw_grid (GcalWeekView *view,
|
|||||||
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);
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
alloc->x + padding->left + priv->grid_sidebar_size + priv->horizontal_step * i + 1 + ((priv->horizontal_step - font_width) / 2),
|
start_grid_x + priv->horizontal_step * i + 6 + (gint) ( (max_day_width - font_width) / 2),
|
||||||
alloc->y + padding->top + priv->header_size);
|
start_grid_y - priv->grid_header_size);
|
||||||
pango_cairo_show_layout (cr, layout);
|
pango_cairo_show_layout (cr, layout);
|
||||||
|
|
||||||
g_free (weekday_header);
|
g_free (weekday_header);
|
||||||
@@ -774,6 +826,7 @@ gcal_week_view_draw_grid (GcalWeekView *view,
|
|||||||
g_free (start_of_week);
|
g_free (start_of_week);
|
||||||
|
|
||||||
/* draw grid_sidebar */
|
/* draw grid_sidebar */
|
||||||
|
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 1);
|
||||||
pango_layout_set_text (layout, _("All day"), -1);
|
pango_layout_set_text (layout, _("All day"), -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);
|
||||||
@@ -807,29 +860,37 @@ gcal_week_view_draw_grid (GcalWeekView *view,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* grid, vertical lines first */
|
/* grid, vertical lines first */
|
||||||
|
cairo_set_line_width (cr, 1.5);
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
alloc->x + padding->left + priv->grid_sidebar_size + priv->horizontal_step * i,
|
start_grid_x + priv->horizontal_step * i,
|
||||||
alloc->y + padding->top + priv->header_size + priv->grid_header_size);
|
start_grid_y);
|
||||||
cairo_line_to (cr,
|
cairo_rel_line_to (cr, 0, priv->vertical_step * ((10 / priv->hours_steps) + 1));
|
||||||
alloc->x + padding->left + priv->grid_sidebar_size + priv->horizontal_step * i,
|
|
||||||
alloc->y + padding->top + priv->header_size + priv->grid_header_size + priv->vertical_step * ((10 / priv->hours_steps) + 1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* rest of the lines */
|
/* rest of the lines */
|
||||||
for (i = 0; i <= 10 / priv->hours_steps + 1; i++)
|
for (i = 0; i <= 10 / priv->hours_steps + 1; i++)
|
||||||
{
|
{
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
alloc->x + padding->left + priv->grid_sidebar_size,
|
start_grid_x,
|
||||||
alloc->y + padding->top + priv->header_size + priv->grid_header_size + priv->vertical_step * i);
|
start_grid_y + priv->vertical_step * i);
|
||||||
cairo_line_to (cr,
|
cairo_rel_line_to (cr, priv->horizontal_step * 7, 0);
|
||||||
alloc->x + padding->left + priv->grid_sidebar_size + priv->horizontal_step * 7,
|
|
||||||
alloc->y + padding->top + priv->header_size + priv->grid_header_size + priv->vertical_step * i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
|
|
||||||
|
/* drawing selected_cell */
|
||||||
|
//FIXME: What to do when the selected date isn't on the in the month
|
||||||
|
cairo_set_source_rgba (cr, selected_color.red, selected_color.green, selected_color.blue, 1);
|
||||||
|
/* Two pixel line on the selected day cell */
|
||||||
|
cairo_set_line_width (cr, 2.0);
|
||||||
|
cairo_move_to (cr,
|
||||||
|
start_grid_x + priv->horizontal_step * ( actual_day % 7),
|
||||||
|
start_grid_y);
|
||||||
|
cairo_rel_line_to (cr, priv->horizontal_step, 0);
|
||||||
|
cairo_stroke (cr);
|
||||||
|
|
||||||
g_object_unref (layout);
|
g_object_unref (layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user