month-view: implement a different hiding algorithm

As if the previous one wasn't crazy enough :(
This commit is contained in:
Georges Basile Stavracas Neto
2017-11-13 19:27:55 -02:00
parent b4cc36b344
commit 8d6785b6f7
3 changed files with 173 additions and 28 deletions
+10 -3
View File
@@ -568,7 +568,7 @@ gcal_month_cell_set_overflow (GcalMonthCell *self,
}
gint
gcal_month_cell_get_real_height (GcalMonthCell *self)
gcal_month_cell_get_content_space (GcalMonthCell *self)
{
GtkStyleContext *context;
GtkBorder padding;
@@ -581,8 +581,7 @@ gcal_month_cell_get_real_height (GcalMonthCell *self)
gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
return gtk_widget_get_allocated_height (GTK_WIDGET (self)) -
gtk_widget_get_allocated_height (self->overflow_button) -
gtk_widget_get_allocated_height (self->header_box) -
gcal_month_cell_get_header_height (self) -
padding.top - padding.bottom -
border.top - border.bottom;
}
@@ -607,6 +606,14 @@ gcal_month_cell_get_header_height (GcalMonthCell *self)
border.top + border.bottom;
}
gint
gcal_month_cell_get_overflow_height (GcalMonthCell *self)
{
g_return_val_if_fail (GCAL_IS_MONTH_CELL (self), -1);
return gtk_widget_get_allocated_height (self->overflow_button);
}
gboolean
gcal_month_cell_get_selected (GcalMonthCell *self)
{