From d66a76af887d82bf1230f5f4b6858916bf7d736d Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 4 May 2018 21:49:30 -0300 Subject: [PATCH] event-widget: React to time changes When an event is timed, and we move past its end date and time, the event does not react to that and continues with the opacity of a regular event. Fix that by reacting to minute changes. --- src/gcal-event-widget.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c index ad010255..01c726ef 100644 --- a/src/gcal-event-widget.c +++ b/src/gcal-event-widget.c @@ -22,6 +22,8 @@ #include #include +#include "gcal-application.h" +#include "gcal-clock.h" #include "gcal-event-widget.h" #include "gcal-utils.h" @@ -950,6 +952,7 @@ gcal_event_widget_class_init (GcalEventWidgetClass *klass) static void gcal_event_widget_init (GcalEventWidget *self) { + GcalApplication *application; GtkWidget *widget; widget = GTK_WIDGET (self); @@ -966,6 +969,17 @@ gcal_event_widget_init (GcalEventWidget *self) /* Starts with horizontal */ self->orientation = GTK_ORIENTATION_HORIZONTAL; gtk_style_context_add_class (gtk_widget_get_style_context (widget), "horizontal"); + + /* Connect to the wall clock */ + application = GCAL_APPLICATION (g_application_get_default ()); + + g_assert (application != NULL); + + g_signal_connect_object (gcal_application_get_clock (application), + "minute-changed", + G_CALLBACK (update_color), + self, + G_CONNECT_SWAPPED); } GtkWidget*