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.
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <string.h>
|
||||
|
||||
#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*
|
||||
|
||||
Reference in New Issue
Block a user