diff options
author | Benjamin Otte <otte@redhat.com> | 2018-10-05 23:24:18 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-30 19:26:45 -0400 |
commit | 057effc5d6c349edcf31c5596262790367557af1 (patch) | |
tree | 04ad62684c592ff8cb2eb3c63ac42df0c9cb1c66 /gtk/gtklistitemmanager.c | |
parent | d8c116f20ab99dee036f2913a48ad4eed56d8a88 (diff) | |
download | gtk+-057effc5d6c349edcf31c5596262790367557af1.tar.gz |
listitem: Add a press gesture to select the item
This is implemented by using actions, which are a neat trick to get to
allow the ListItem to call functions on the ListView without actually
needing to be aware of it.
Diffstat (limited to 'gtk/gtklistitemmanager.c')
-rw-r--r-- | gtk/gtklistitemmanager.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtklistitemmanager.c b/gtk/gtklistitemmanager.c index e7c11f483f..00bce1a10b 100644 --- a/gtk/gtklistitemmanager.c +++ b/gtk/gtklistitemmanager.c @@ -21,6 +21,7 @@ #include "gtklistitemmanagerprivate.h" +#include "gtklistitemprivate.h" #include "gtkwidgetprivate.h" struct _GtkListItemManager @@ -260,7 +261,8 @@ gtk_list_item_manager_acquire_list_item (GtkListItemManager *self, g_return_val_if_fail (GTK_IS_LIST_ITEM_MANAGER (self), NULL); g_return_val_if_fail (prev_sibling == NULL || GTK_IS_WIDGET (prev_sibling), NULL); - result = gtk_list_item_factory_create (self->factory); + result = gtk_list_item_new ("row"); + gtk_list_item_factory_setup (self->factory, result); item = g_list_model_get_item (G_LIST_MODEL (self->model), position); selected = gtk_selection_model_is_selected (self->model, position); |