From: Benjamin Otte Date: Tue, 7 Mar 2023 23:53:51 +0000 (+0100) Subject: inspector: Use scroll_to() in the object tree search X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~2^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a447c439f4143298ff055cf373a5a13ff1eaf1e6;p=gtk4.git inspector: Use scroll_to() in the object tree search --- diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c index 0c0c9e28ab..b86f9bcbe5 100644 --- a/gtk/inspector/object-tree.c +++ b/gtk/inspector/object-tree.c @@ -910,7 +910,11 @@ search (GtkInspectorObjectTree *wt, { if (match_object (child, text)) { - gtk_single_selection_set_selected (priv->selection, row); + gtk_column_view_scroll_to (GTK_COLUMN_VIEW (wt->priv->list), + row, + NULL, + GTK_LIST_SCROLL_SELECT | GTK_LIST_SCROLL_FOCUS, + NULL); g_object_unref (child); g_object_unref (row_item); return TRUE; @@ -1302,8 +1306,12 @@ gtk_inspector_object_tree_select_object (GtkInspectorObjectTree *wt, if (row_item == NULL) return; - gtk_single_selection_set_selected (wt->priv->selection, - gtk_tree_list_row_get_position (row_item)); + gtk_column_view_scroll_to (GTK_COLUMN_VIEW (wt->priv->list), + gtk_tree_list_row_get_position (row_item), + NULL, + GTK_LIST_SCROLL_SELECT | GTK_LIST_SCROLL_FOCUS, + NULL); + g_signal_emit (wt, signals[OBJECT_SELECTED], 0, object); // FIXME g_object_unref (row_item); }