fontchooser: Don't show "No fonts" prematurely

Don't switch to the empty page while we are still busy
filtering. Fonts might yet appear.
This commit is contained in:
Matthias Clasen 2020-09-19 10:25:45 -04:00
parent 76b7f0ca1c
commit a9bf129286
2 changed files with 3 additions and 1 deletions

View File

@ -774,7 +774,8 @@ rows_changed_cb (GtkFontChooserWidget *self)
{
const char *page;
if (g_list_model_get_n_items (G_LIST_MODEL (self->selection)) == 0)
if (g_list_model_get_n_items (G_LIST_MODEL (self->selection)) == 0 &&
gtk_filter_list_model_get_pending (GTK_FILTER_LIST_MODEL (self->filter_model)) == 0)
page = "empty";
else
page = "list";

View File

@ -5,6 +5,7 @@
<signal name="items-changed" handler="rows_changed_cb" object="GtkFontChooserWidget" swapped="1" />
<property name="model">
<object class="GtkFilterListModel" id="filter_model">
<signal name="notify::pending" handler="rows_changed_cb" object="GtkFontChooserWidget" swapped="1" />
<property name="incremental">1</property>
<property name="filter">
<object class="GtkEveryFilter">