[gtk/wip/otte/for-master: 1/3] listitemmanager: Update selections properly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-master: 1/3] listitemmanager: Update selections properly
- Date: Mon, 8 Jun 2020 17:10:05 +0000 (UTC)
commit 5d9dc25115e111c71d27ea765cf1a31fa0f256ef
Author: Benjamin Otte <otte redhat com>
Date: Mon Jun 8 18:06:01 2020 +0200
listitemmanager: Update selections properly
Replace a previous fix with a more correct one: Update the
selected state from the model instead of reusing the old state, the
model might have updated the selected state.
gtk/gtklistitemmanager.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
---
diff --git a/gtk/gtklistitemmanager.c b/gtk/gtklistitemmanager.c
index e08592bca8..34c52e48bd 100644
--- a/gtk/gtklistitemmanager.c
+++ b/gtk/gtklistitemmanager.c
@@ -395,7 +395,6 @@ gtk_list_item_manager_add_items (GtkListItemManager *self,
if (item == NULL || item->widget)
item = gtk_rb_tree_insert_before (self->items, item);
-
item->n_items += n_items;
gtk_rb_tree_node_mark_dirty (item);
@@ -570,12 +569,6 @@ gtk_list_item_manager_ensure_items (GtkListItemManager *self,
gtk_list_item_manager_release_list_item (self, NULL, widget);
}
-static void
-gtk_list_item_manager_model_selection_changed_cb (GListModel *model,
- guint position,
- guint n_items,
- GtkListItemManager *self);
-
static void
gtk_list_item_manager_model_items_changed_cb (GListModel *model,
guint position,
@@ -742,8 +735,6 @@ gtk_list_item_manager_model_items_changed_cb (GListModel *model,
g_hash_table_unref (change);
- gtk_list_item_manager_model_selection_changed_cb (model, position, added, self);
-
gtk_widget_queue_resize (self->widget);
}
@@ -988,7 +979,7 @@ gtk_list_item_manager_try_reacquire_list_item (GtkListItemManager *self,
gtk_list_item_widget_update (list_item,
position,
gtk_list_item_widget_get_item (list_item),
- gtk_list_item_widget_get_selected (list_item));
+ gtk_selection_model_is_selected (self->model, position));
gtk_widget_insert_after (result, self->widget, prev_sibling);
/* XXX: Should we let the listview do this? */
gtk_widget_queue_resize (result);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]