mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-05 18:31:09 +00:00
font chooser: Make Escape stop search
This commit is contained in:
parent
e548c71394
commit
61ffb517bc
@ -301,12 +301,18 @@ gtk_font_chooser_widget_refilter_font_list (GtkFontChooserWidget *fontchooser)
|
||||
|
||||
static void
|
||||
text_changed_cb (GtkEntry *entry,
|
||||
GParamSpec *pspec,
|
||||
GtkFontChooserWidget *fc)
|
||||
{
|
||||
gtk_font_chooser_widget_refilter_font_list (fc);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_search_cb (GtkEntry *entry,
|
||||
GtkFontChooserWidget *fc)
|
||||
{
|
||||
gtk_entry_set_text (entry, "");
|
||||
}
|
||||
|
||||
static void
|
||||
size_change_cb (GtkAdjustment *adjustment,
|
||||
gpointer user_data)
|
||||
@ -580,6 +586,7 @@ gtk_font_chooser_widget_class_init (GtkFontChooserWidgetClass *klass)
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_slider);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, text_changed_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, stop_search_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, cursor_changed_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, row_activated_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, gtk_font_chooser_widget_set_cell_size);
|
||||
|
@ -48,7 +48,8 @@
|
||||
<property name="primary_icon_sensitive">False</property>
|
||||
<property name="secondary_icon_sensitive">False</property>
|
||||
<property name="placeholder_text" translatable="yes">Search font name</property>
|
||||
<signal name="notify::text" 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"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
|
Loading…
Reference in New Issue
Block a user