[gnome-calendar] month-view: hide last row if it's empty



commit bb2566dab80d150cd78275ca402af20f688bceed
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun Nov 19 12:29:29 2017 -0200

    month-view: hide last row if it's empty
    
    This can make it put up to 5 events in my 1366x768 screen!
    
    \o/

 src/views/gcal-month-view.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/views/gcal-month-view.c b/src/views/gcal-month-view.c
index a70f714..b4d7f2b 100644
--- a/src/views/gcal-month-view.c
+++ b/src/views/gcal-month-view.c
@@ -903,8 +903,10 @@ static gboolean
 update_month_cells (GcalMonthView *self)
 {
   g_autoptr (GDateTime) dt;
+  gboolean show_last_row;
   guint row, col;
 
+  show_last_row = g_date_get_days_in_month (self->date->month, self->date->year) + self->days_delay > 35;
   dt = g_date_time_new_local (self->date->year, self->date->month, 1, 0, 0, 0);
 
   for (row = 0; row < 6; row++)
@@ -936,6 +938,9 @@ update_month_cells (GcalMonthView *self)
 
           gcal_month_cell_set_different_month (cell, different_month);
 
+          /* If the last row is empty, hide it */
+          gtk_widget_set_visible (GTK_WIDGET (cell), show_last_row || row < 5);
+
           if (different_month)
             {
               gcal_month_cell_set_selected (cell, FALSE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]