month-cell: improve calculation of header box height

Should also consider the top and bottom margins.
This commit is contained in:
Georges Basile Stavracas Neto
2017-11-11 18:15:02 -02:00
parent 432e7ab7ea
commit b5ad149261
2 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
<property name="valign">start</property>
<property name="spacing">6</property>
<property name="margin">6</property>
<property name="margin-bottom">3</property>
<property name="margin-bottom">0</property>
<child>
<object class="GtkLabel" id="day_label">
<property name="visible">True</property>
+13 -1
View File
@@ -590,9 +590,21 @@ gcal_month_cell_get_real_height (GcalMonthCell *self)
gint
gcal_month_cell_get_header_height (GcalMonthCell *self)
{
GtkStyleContext *context;
GtkBorder padding;
GtkBorder border;
g_return_val_if_fail (GCAL_IS_MONTH_CELL (self), -1);
return gtk_widget_get_allocated_height (self->header_box);
context = gtk_widget_get_style_context (GTK_WIDGET (self->header_box));
gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
return gtk_widget_get_allocated_height (self->header_box) +
gtk_widget_get_margin_top (self->header_box) +
gtk_widget_get_margin_bottom (self->header_box) +
padding.top + padding.bottom +
border.top + border.bottom;
}
gboolean