week-header: set correct padding for the grid
Set the margin top, left, and right for the grid, according to the mockups.
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
62d8fdc057
commit
665f91701b
@@ -65,7 +65,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="column-homogeneous">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="column-spacing">7</property>
|
||||
<property name="column-spacing">8</property>
|
||||
<property name="row-spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
|
||||
@@ -331,15 +331,29 @@ gcal_week_header_size_allocate (GtkWidget *widget,
|
||||
GcalWeekHeader *self = GCAL_WEEK_HEADER (widget);
|
||||
GtkStyleContext *context;
|
||||
GtkStateFlags state;
|
||||
GtkAllocation draw_alloc;
|
||||
|
||||
gdouble sidebar_width, cell_width;
|
||||
|
||||
PangoFontDescription *bold_font;
|
||||
|
||||
context = gtk_widget_get_style_context (self->draw_area);
|
||||
state = gtk_widget_get_state_flags (self->draw_area);
|
||||
sidebar_width = gcal_week_view_get_sidebar_width (self->draw_area);
|
||||
|
||||
gtk_widget_get_allocation (self->draw_area, &draw_alloc);
|
||||
|
||||
cell_width = (draw_alloc.width - sidebar_width) / 7;
|
||||
|
||||
gtk_style_context_get (context, state, "font", &bold_font, NULL);
|
||||
pango_font_description_set_weight (bold_font, PANGO_WEIGHT_SEMIBOLD);
|
||||
|
||||
gtk_widget_set_margin_start (self->scrolledwindow,
|
||||
gcal_week_view_get_sidebar_width (self->draw_area) + 1);
|
||||
|
||||
gtk_widget_set_margin_end (self->scrolledwindow,
|
||||
gtk_widget_get_allocated_width (self->draw_area) - cell_width * 7 - sidebar_width + 7);
|
||||
|
||||
gtk_widget_set_margin_top (self->scrolledwindow,
|
||||
(4 * pango_font_description_get_size (bold_font)) / PANGO_SCALE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user