inspector: Work with new search entry

Don't assume a search entry is an entry, and
use the editable api as far as possible.
This commit is contained in:
Matthias Clasen 2019-02-16 23:58:54 -05:00
parent 3a1a7c43f3
commit b8c981fb2b
4 changed files with 9 additions and 9 deletions

View File

@ -916,7 +916,7 @@ search (GtkInspectorObjectTree *wt,
guint i, selected, n, row;
const char *text;
text = gtk_entry_get_text (GTK_ENTRY (priv->search_entry));
text = gtk_editable_get_text (GTK_EDITABLE (priv->search_entry));
if (gtk_list_box_get_selected_row (priv->list))
{
selected = gtk_list_box_row_get_index (gtk_list_box_get_selected_row (priv->list));
@ -998,7 +998,7 @@ static void
stop_search (GtkWidget *entry,
GtkInspectorObjectTree *wt)
{
gtk_entry_set_text (GTK_ENTRY (wt->priv->search_entry), "");
gtk_editable_set_text (GTK_EDITABLE (wt->priv->search_entry), "");
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (wt->priv->search_bar), FALSE);
}
@ -1155,7 +1155,7 @@ gtk_inspector_object_tree_init (GtkInspectorObjectTree *wt)
gtk_widget_init_template (GTK_WIDGET (wt));
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (wt->priv->search_bar),
GTK_ENTRY (wt->priv->search_entry));
GTK_EDITABLE (wt->priv->search_entry));
root_model = create_root_model ();
wt->priv->tree_model = gtk_tree_list_model_new (FALSE,

View File

@ -79,7 +79,7 @@ static void
search_close_clicked (GtkWidget *button,
GtkInspectorPropList *pl)
{
gtk_entry_set_text (GTK_ENTRY (pl->priv->search_entry), "");
gtk_editable_set_text (GTK_EDITABLE (pl->priv->search_entry), "");
gtk_stack_set_visible_child_name (GTK_STACK (pl->priv->search_stack), "title");
}
@ -275,7 +275,7 @@ constructed (GObject *object)
pl->priv->search_stack = gtk_widget_get_parent (pl->priv->search_entry);
gtk_tree_view_set_search_entry (GTK_TREE_VIEW (pl->priv->tree),
GTK_ENTRY (pl->priv->search_entry));
GTK_EDITABLE (pl->priv->search_entry));
g_signal_connect (pl->priv->search_entry, "stop-search",
G_CALLBACK (search_close_clicked), pl);
@ -525,7 +525,7 @@ gtk_inspector_prop_list_set_object (GtkInspectorPropList *pl,
cleanup_object (pl);
gtk_entry_set_text (GTK_ENTRY (pl->priv->search_entry), "");
gtk_editable_set_text (GTK_EDITABLE (pl->priv->search_entry), "");
gtk_stack_set_visible_child_name (GTK_STACK (pl->priv->search_stack), "title");
if (pl->priv->child_properties)

View File

@ -548,7 +548,7 @@ match_row (GtkTreeModel *model,
const gchar *text;
gboolean match;
text = gtk_entry_get_text (GTK_ENTRY (sl->priv->search_entry));
text = gtk_editable_get_text (GTK_EDITABLE (sl->priv->search_entry));
gtk_tree_model_get (model, iter,
COLUMN_NAME, &name,
COLUMN_PATH, &path,
@ -622,7 +622,7 @@ gtk_inspector_resource_list_init (GtkInspectorResourceList *sl)
g_signal_connect (sl, "map", G_CALLBACK (on_map), NULL);
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (sl->priv->search_bar),
GTK_ENTRY (sl->priv->search_entry));
GTK_EDITABLE (sl->priv->search_entry));
g_signal_connect (sl->priv->search_bar, "notify::search-mode-enabled",
G_CALLBACK (search_mode_changed), sl);

View File

@ -374,7 +374,7 @@ gtk_inspector_statistics_init (GtkInspectorStatistics *sl)
GINT_TO_POINTER (COLUMN_CUMULATIVE2), NULL);
sl->priv->counts = g_hash_table_new_full (NULL, NULL, NULL, type_data_free);
gtk_tree_view_set_search_entry (sl->priv->view, GTK_ENTRY (sl->priv->search_entry));
gtk_tree_view_set_search_entry (sl->priv->view, GTK_EDITABLE (sl->priv->search_entry));
gtk_tree_view_set_search_equal_func (sl->priv->view, match_row, sl, NULL);
g_signal_connect (sl, "hierarchy-changed", G_CALLBACK (hierarchy_changed), NULL);
}