[gtk/wip/fontchooser-language-filtering: 186/186] fontchooser: Don't show "No fonts" prematurely
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/fontchooser-language-filtering: 186/186] fontchooser: Don't show "No fonts" prematurely
- Date: Sat, 19 Sep 2020 14:29:06 +0000 (UTC)
commit a9bf129286bd91904d117a459362f733fd70f5a5
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 19 10:25:45 2020 -0400
fontchooser: Don't show "No fonts" prematurely
Don't switch to the empty page while we are still busy
filtering. Fonts might yet appear.
gtk/gtkfontchooserwidget.c | 3 ++-
gtk/ui/gtkfontchooserwidget.ui | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index 681466714b..ede2ce8bf4 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -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";
diff --git a/gtk/ui/gtkfontchooserwidget.ui b/gtk/ui/gtkfontchooserwidget.ui
index c3933c84b2..96c259687e 100644
--- a/gtk/ui/gtkfontchooserwidget.ui
+++ b/gtk/ui/gtkfontchooserwidget.ui
@@ -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">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]