[gtk/text: 10/17] font chooser: Use editable api on search entry



commit f9c7337b5604e5ee2efd483895e69b5797e408af
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Feb 17 14:48:08 2019 -0500

    font chooser: Use editable api on search entry

 gtk/gtkfontchooserwidget.c     | 10 +++++-----
 gtk/ui/gtkfontchooserwidget.ui |  6 ------
 2 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index afe1b922fb..9c11c298c7 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -372,11 +372,11 @@ text_changed_cb (GtkEntry             *entry,
 }
 
 static void
-stop_search_cb (GtkEntry             *entry,
+stop_search_cb (GtkSearchEntry       *entry,
                 GtkFontChooserWidget *fc)
 {
-  if (gtk_entry_get_text (entry)[0] != 0)
-    gtk_entry_set_text (entry, "");
+  if (gtk_editable_get_text (GTK_EDITABLE (entry))[0] != 0)
+    gtk_editable_set_text (GTK_EDITABLE (entry), "");
   else
     {
       GtkWidget *dialog;
@@ -623,7 +623,7 @@ gtk_font_chooser_widget_map (GtkWidget *widget)
   GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (widget);
   GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
 
-  gtk_entry_set_text (GTK_ENTRY (priv->search_entry), "");
+  gtk_editable_set_text (GTK_EDITABLE (priv->search_entry), "");
   gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "list");
   g_simple_action_set_state (G_SIMPLE_ACTION (priv->tweak_action), g_variant_new_boolean (FALSE));
 
@@ -1034,7 +1034,7 @@ visible_func (GtkTreeModel *model,
     }
 
   /* If there's no filter string we show the item */
-  search_text = gtk_entry_get_text (GTK_ENTRY (priv->search_entry));
+  search_text = gtk_editable_get_text (GTK_EDITABLE (priv->search_entry));
   if (strlen (search_text) == 0)
     return TRUE;
 
diff --git a/gtk/ui/gtkfontchooserwidget.ui b/gtk/ui/gtkfontchooserwidget.ui
index 5d06c53cd2..25b1f7083a 100644
--- a/gtk/ui/gtkfontchooserwidget.ui
+++ b/gtk/ui/gtkfontchooserwidget.ui
@@ -36,14 +36,8 @@
                 <property name="column-spacing">6</property>
                 <child>
                   <object class="GtkSearchEntry" id="search_entry">
-                    <property name="can-focus">1</property>
                     <property name="hexpand">1</property>
                     <property name="activates-default">1</property>
-                    <property name="primary-icon-name">edit-find-symbolic</property>
-                    <property name="primary-icon-activatable">0</property>
-                    <property name="secondary-icon-activatable">0</property>
-                    <property name="primary-icon-sensitive">0</property>
-                    <property name="secondary-icon-sensitive">0</property>
                     <property name="placeholder-text" translatable="yes">Search font name</property>
                     <signal name="search-changed" handler="text_changed_cb" swapped="no"/>
                     <signal name="stop-search" handler="stop_search_cb" swapped="no"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]