From c8a720aaa5cde20304814b8dd7f9b207c8d1ec28 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 1 Mar 2023 12:00:26 -0500 Subject: [PATCH] columview: Propagate activatable and selectable When any of the cells is not activatable or selectable, make the row not have those properties either. --- gtk/gtkcolumnlistitemfactory.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk/gtkcolumnlistitemfactory.c b/gtk/gtkcolumnlistitemfactory.c index d69bd12e04..8ddffc252c 100644 --- a/gtk/gtkcolumnlistitemfactory.c +++ b/gtk/gtkcolumnlistitemfactory.c @@ -103,6 +103,8 @@ gtk_column_list_item_factory_update (GtkListItemFactory *factory, { GtkListItem *list_item = GTK_LIST_ITEM (item); GtkWidget *child; + gboolean selectable = TRUE; + gboolean activatable = TRUE; GTK_LIST_ITEM_FACTORY_CLASS (gtk_column_list_item_factory_parent_class)->update (factory, item, unbind, bind, func, data); @@ -114,7 +116,18 @@ gtk_column_list_item_factory_update (GtkListItemFactory *factory, gtk_list_item_get_position (list_item), gtk_list_item_get_item (list_item), gtk_list_item_get_selected (list_item)); + + selectable &= gtk_list_item_get_selectable (gtk_list_item_widget_get_list_item (GTK_LIST_ITEM_WIDGET (child))); + activatable &= gtk_list_item_get_activatable (gtk_list_item_widget_get_list_item (GTK_LIST_ITEM_WIDGET (child))); } + + /* This really does not belong here, but doing better + * requires considerable plumbing that we don't have now, + * and something like this is needed to fix the filechooser + * in select_folder mode. + */ + gtk_list_item_set_selectable (list_item, selectable); + gtk_list_item_set_activatable (list_item, activatable); } static void