diff --git a/src/gui/views/gcal-month-popover.blp b/src/gui/views/gcal-month-popover.blp index aaeb331b..756ad653 100644 --- a/src/gui/views/gcal-month-popover.blp +++ b/src/gui/views/gcal-month-popover.blp @@ -47,6 +47,7 @@ template $GcalMonthPopover: Widget { ListBox listbox { vexpand: true; selection-mode: none; + row-activated => $on_list_box_row_activated_cb(template) not-swapped; styles [ "calendar-list", diff --git a/src/gui/views/gcal-month-popover.c b/src/gui/views/gcal-month-popover.c index b4d951b6..b2d0572d 100644 --- a/src/gui/views/gcal-month-popover.c +++ b/src/gui/views/gcal-month-popover.c @@ -120,15 +120,23 @@ update_event_list (GcalMonthPopover *self) event_end = g_date_time_add_days (event_start, 1); event_widget = gcal_event_widget_new (self->context, event); + gtk_widget_set_focusable (event_widget, FALSE); gcal_event_widget_set_date_start (GCAL_EVENT_WIDGET (event_widget), event_start); gcal_event_widget_set_date_end (GCAL_EVENT_WIDGET (event_widget), event_end); row = gtk_list_box_row_new (); gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (row), event_widget); - gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE); gtk_list_box_append (self->listbox, row); + gtk_accessible_update_property (GTK_ACCESSIBLE (row), + GTK_ACCESSIBLE_PROPERTY_HAS_POPUP, TRUE, + -1); + + gtk_accessible_update_relation (GTK_ACCESSIBLE (row), + GTK_ACCESSIBLE_RELATION_LABELLED_BY, event_widget, NULL, + -1); + g_signal_connect_object (event_widget, "activate", G_CALLBACK (event_activated_cb), @@ -187,6 +195,18 @@ sort_func (GtkListBoxRow *a, * Callbacks */ +static void +on_list_box_row_activated_cb (GtkListBox *list_box, + GtkListBoxRow *row, + GcalMonthPopover *self) +{ + GtkWidget *child = gtk_list_box_row_get_child (row); + + g_assert (GCAL_IS_EVENT_WIDGET (child)); + + gtk_widget_activate (child); +} + static void animation_cb (gdouble value, gpointer user_data) @@ -398,6 +418,7 @@ gcal_month_popover_class_init (GcalMonthPopoverClass *klass) gtk_widget_class_bind_template_callback (widget_class, close_button_clicked_cb); gtk_widget_class_bind_template_callback (widget_class, new_event_button_clicked_cb); + gtk_widget_class_bind_template_callback (widget_class, on_list_box_row_activated_cb); gtk_widget_class_bind_template_child (widget_class, GcalMonthPopover, day_label); gtk_widget_class_bind_template_child (widget_class, GcalMonthPopover, listbox); diff --git a/src/theme/style.css b/src/theme/style.css index b28a687f..ab7d742f 100644 --- a/src/theme/style.css +++ b/src/theme/style.css @@ -59,6 +59,11 @@ popover.event-popover > contents { background-color: transparent; } +.calendar-list > row { + background-color: transparent; + border-radius: 10px; +} + .calendar-list > list { border-radius: 4px; }