views/month-popover: Only focus rows
This follows the same approach as https://gitlab.gnome.org/GNOME/gnome-calendar/-/commit/0aaf13626c0bb7e8ade2d79e8b50132b3a583c9f?merge_request_iid=559 Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/598>
This commit is contained in:
@@ -47,6 +47,7 @@ template $GcalMonthPopover: Widget {
|
|||||||
ListBox listbox {
|
ListBox listbox {
|
||||||
vexpand: true;
|
vexpand: true;
|
||||||
selection-mode: none;
|
selection-mode: none;
|
||||||
|
row-activated => $on_list_box_row_activated_cb(template) not-swapped;
|
||||||
|
|
||||||
styles [
|
styles [
|
||||||
"calendar-list",
|
"calendar-list",
|
||||||
|
|||||||
@@ -120,15 +120,23 @@ update_event_list (GcalMonthPopover *self)
|
|||||||
event_end = g_date_time_add_days (event_start, 1);
|
event_end = g_date_time_add_days (event_start, 1);
|
||||||
|
|
||||||
event_widget = gcal_event_widget_new (self->context, event);
|
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_start (GCAL_EVENT_WIDGET (event_widget), event_start);
|
||||||
gcal_event_widget_set_date_end (GCAL_EVENT_WIDGET (event_widget), event_end);
|
gcal_event_widget_set_date_end (GCAL_EVENT_WIDGET (event_widget), event_end);
|
||||||
|
|
||||||
row = gtk_list_box_row_new ();
|
row = gtk_list_box_row_new ();
|
||||||
gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (row), event_widget);
|
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_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,
|
g_signal_connect_object (event_widget,
|
||||||
"activate",
|
"activate",
|
||||||
G_CALLBACK (event_activated_cb),
|
G_CALLBACK (event_activated_cb),
|
||||||
@@ -187,6 +195,18 @@ sort_func (GtkListBoxRow *a,
|
|||||||
* Callbacks
|
* 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
|
static void
|
||||||
animation_cb (gdouble value,
|
animation_cb (gdouble value,
|
||||||
gpointer user_data)
|
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, 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, 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, day_label);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalMonthPopover, listbox);
|
gtk_widget_class_bind_template_child (widget_class, GcalMonthPopover, listbox);
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ popover.event-popover > contents {
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendar-list > row {
|
||||||
|
background-color: transparent;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.calendar-list > list {
|
.calendar-list > list {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user