month-cell: Move day label to top, split from overflow

This commit is contained in:
Georges Basile Stavracas Neto
2017-11-11 17:48:59 -02:00
parent af90070cf4
commit 4dd4c2410f
4 changed files with 47 additions and 23 deletions
+11
View File
@@ -32,6 +32,7 @@ struct _GcalMonthCell
guint n_overflow;
GtkLabel *day_label;
GtkWidget *header_box;
GtkWidget *overflow_button;
GtkWidget *overflow_label;
GtkWidget *overlay;
@@ -422,6 +423,7 @@ gcal_month_cell_class_init (GcalMonthCellClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/month-cell.ui");
gtk_widget_class_bind_template_child (widget_class, GcalMonthCell, day_label);
gtk_widget_class_bind_template_child (widget_class, GcalMonthCell, header_box);
gtk_widget_class_bind_template_child (widget_class, GcalMonthCell, overflow_button);
gtk_widget_class_bind_template_child (widget_class, GcalMonthCell, overflow_label);
gtk_widget_class_bind_template_child (widget_class, GcalMonthCell, overlay);
@@ -580,10 +582,19 @@ gcal_month_cell_get_real_height (GcalMonthCell *self)
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) -
padding.top - padding.bottom -
border.top - border.bottom;
}
gint
gcal_month_cell_get_header_height (GcalMonthCell *self)
{
g_return_val_if_fail (GCAL_IS_MONTH_CELL (self), -1);
return gtk_widget_get_allocated_height (self->header_box);
}
gboolean
gcal_month_cell_get_selected (GcalMonthCell *self)
{