forked from AuroraMiddleware/gtk
font chooser: Use editable api on search entry
This commit is contained in:
parent
7d9e63ae38
commit
37b841b59b
@ -372,11 +372,11 @@ text_changed_cb (GtkEntry *entry,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stop_search_cb (GtkEntry *entry,
|
stop_search_cb (GtkSearchEntry *entry,
|
||||||
GtkFontChooserWidget *fc)
|
GtkFontChooserWidget *fc)
|
||||||
{
|
{
|
||||||
if (gtk_entry_get_text (entry)[0] != 0)
|
if (gtk_editable_get_text (GTK_EDITABLE (entry))[0] != 0)
|
||||||
gtk_entry_set_text (entry, "");
|
gtk_editable_set_text (GTK_EDITABLE (entry), "");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
@ -623,7 +623,7 @@ gtk_font_chooser_widget_map (GtkWidget *widget)
|
|||||||
GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (widget);
|
GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (widget);
|
||||||
GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
|
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");
|
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));
|
g_simple_action_set_state (G_SIMPLE_ACTION (priv->tweak_action), g_variant_new_boolean (FALSE));
|
||||||
|
|
||||||
@ -767,7 +767,7 @@ change_tweak (GSimpleAction *action,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtk_entry_grab_focus_without_selecting (GTK_ENTRY (fontchooser->priv->search_entry));
|
gtk_widget_grab_focus (fontchooser->priv->search_entry);
|
||||||
gtk_stack_set_visible_child_name (GTK_STACK (fontchooser->priv->stack), "list");
|
gtk_stack_set_visible_child_name (GTK_STACK (fontchooser->priv->stack), "list");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1034,7 +1034,7 @@ visible_func (GtkTreeModel *model,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If there's no filter string we show the item */
|
/* 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)
|
if (strlen (search_text) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -36,14 +36,8 @@
|
|||||||
<property name="column-spacing">6</property>
|
<property name="column-spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSearchEntry" id="search_entry">
|
<object class="GtkSearchEntry" id="search_entry">
|
||||||
<property name="can-focus">1</property>
|
|
||||||
<property name="hexpand">1</property>
|
<property name="hexpand">1</property>
|
||||||
<property name="activates-default">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>
|
<property name="placeholder-text" translatable="yes">Search font name</property>
|
||||||
<signal name="search-changed" handler="text_changed_cb" swapped="no"/>
|
<signal name="search-changed" handler="text_changed_cb" swapped="no"/>
|
||||||
<signal name="stop-search" handler="stop_search_cb" swapped="no"/>
|
<signal name="stop-search" handler="stop_search_cb" swapped="no"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user