[gtk/text: 13/26] inspector: Work with new search entry
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/text: 13/26] inspector: Work with new search entry
- Date: Tue, 19 Feb 2019 05:05:38 +0000 (UTC)
commit 08c03c0c15eade2df30aa008df6a55ed9c72112d
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Feb 16 23:58:54 2019 -0500
inspector: Work with new search entry
Don't assume a search entry is an entry, and
use the editable api as far as possible.
gtk/inspector/object-tree.c | 6 +++---
gtk/inspector/prop-list.c | 6 +++---
gtk/inspector/resource-list.c | 4 ++--
gtk/inspector/statistics.c | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c
index f2a2f13e1b..618cf0866f 100644
--- a/gtk/inspector/object-tree.c
+++ b/gtk/inspector/object-tree.c
@@ -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,
diff --git a/gtk/inspector/prop-list.c b/gtk/inspector/prop-list.c
index 87aa1d7548..d12a97bd7e 100644
--- a/gtk/inspector/prop-list.c
+++ b/gtk/inspector/prop-list.c
@@ -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)
diff --git a/gtk/inspector/resource-list.c b/gtk/inspector/resource-list.c
index 78e116a992..b1d99223fd 100644
--- a/gtk/inspector/resource-list.c
+++ b/gtk/inspector/resource-list.c
@@ -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);
diff --git a/gtk/inspector/statistics.c b/gtk/inspector/statistics.c
index ad988be72f..e975c45db6 100644
--- a/gtk/inspector/statistics.c
+++ b/gtk/inspector/statistics.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]