[gnome-calendar/868-month-view-clicking-date-outside-of-month-in-agenda-list-makes-months-out-of-sync] gcal-month-view: Use gcal_view_set_date() to update date on scroll



commit c1735bfcc1522723984c8a7cb556394fc8b5a452
Author: Milan Crha <mcrha redhat com>
Date:   Wed Oct 5 17:04:10 2022 +0200

    gcal-month-view: Use gcal_view_set_date() to update date on scroll
    
    This way the content of the view is updated properly, otherwise only
    internal GDateTime structure had been updated, but not the view itself.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/868

 src/gui/views/gcal-month-view.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/gui/views/gcal-month-view.c b/src/gui/views/gcal-month-view.c
index cc83f0fa..54930603 100644
--- a/src/gui/views/gcal-month-view.c
+++ b/src/gui/views/gcal-month-view.c
@@ -1685,9 +1685,10 @@ on_scroll_controller_scrolled_cb (GtkEventControllerScroll *scroll_controller,
   diff = self->scroll_value > 0.0 ? 1.0 : -1.0;
   new_date = g_date_time_add_months (self->date, diff);
 
-  gcal_set_date_time (&self->date, new_date);
   self->scroll_value = 0.0;
 
+  gcal_view_set_date (GCAL_VIEW (self), new_date);
+
   g_object_notify (G_OBJECT (self), "active-date");
 
   return GDK_EVENT_STOP;


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