diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-05-08 02:19:18 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-11 22:21:39 -0400 |
commit | 88141103cdf5fd294b19d4473245f42201aa6b93 (patch) | |
tree | 362ab942aad3cb7da2158ca34e865e00a14489c5 /gtk/inspector/actions.c | |
parent | ff91ce9eb45f0aac43b218b05cbf8e5b89ed8e32 (diff) | |
download | gtk+-88141103cdf5fd294b19d4473245f42201aa6b93.tar.gz |
Don't use container api on GtkListBox
Diffstat (limited to 'gtk/inspector/actions.c')
-rw-r--r-- | gtk/inspector/actions.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk/inspector/actions.c b/gtk/inspector/actions.c index d7018078ba..78133cb456 100644 --- a/gtk/inspector/actions.c +++ b/gtk/inspector/actions.c @@ -123,7 +123,7 @@ add_action (GtkInspectorActions *sl, gtk_container_add (GTK_CONTAINER (box), editor); g_object_set_data (G_OBJECT (row), "editor", editor); - gtk_container_add (GTK_CONTAINER (sl->priv->list), row); + gtk_list_box_insert (GTK_LIST_BOX (sl->priv->list), row, -1); g_free (state_string); } @@ -134,12 +134,16 @@ find_row (GtkInspectorActions *sl, { GtkWidget *row = NULL; GtkWidget *widget; + const char *key; for (widget = gtk_widget_get_first_child (sl->priv->list); widget; widget = gtk_widget_get_next_sibling (widget)) { - const char *key = g_object_get_data (G_OBJECT (widget), "key"); + if (!GTK_IS_LIST_BOX_ROW (widget)) + continue; + + key = g_object_get_data (G_OBJECT (widget), "key"); if (g_str_equal (key, action_name)) { row = widget; @@ -167,7 +171,7 @@ action_removed_cb (GActionGroup *group, row = find_row (sl, action_name); if (row) - gtk_container_remove (GTK_CONTAINER (sl->priv->list), row); + gtk_list_box_remove (GTK_LIST_BOX (sl->priv->list), row); } static void @@ -312,7 +316,7 @@ gtk_inspector_actions_set_object (GtkInspectorActions *sl, remove_group (sl, page, sl->priv->group); while ((child = gtk_widget_get_first_child (sl->priv->list))) - gtk_container_remove (GTK_CONTAINER (sl->priv->list), child); + gtk_list_box_remove (GTK_LIST_BOX (sl->priv->list), child); if (GTK_IS_APPLICATION (object)) add_group (sl, page, G_ACTION_GROUP (object)); |