[gnome-control-center] common: Move CcLanguageChooser language placeholder widget into GtkBuilder
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] common: Move CcLanguageChooser language placeholder widget into GtkBuilder
- Date: Mon, 1 Feb 2021 04:09:59 +0000 (UTC)
commit 35ef98806bcee07640c9145cea9084d5face76e8
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Dec 1 10:06:17 2020 +1300
common: Move CcLanguageChooser language placeholder widget into GtkBuilder
panels/common/cc-language-chooser.c | 17 -----------------
panels/common/cc-language-chooser.ui | 7 +++++++
2 files changed, 7 insertions(+), 17 deletions(-)
---
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index d44ccf4dd..9fc59759d 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -41,7 +41,6 @@ struct _CcLanguageChooser {
GtkDialog parent_instance;
GtkWidget *select_button;
- GtkWidget *no_results;
GtkListBoxRow *more_item;
GtkWidget *search_bar;
GtkWidget *language_filter_entry;
@@ -75,16 +74,6 @@ more_widget_new (void)
return GTK_LIST_BOX_ROW (row);
}
-static GtkWidget *
-no_results_widget_new (void)
-{
- GtkWidget *widget;
-
- widget = gtk_label_new (_("No languages found"));
- gtk_widget_set_sensitive (widget, FALSE);
- return widget;
-}
-
static void
add_languages (CcLanguageChooser *chooser,
gchar **locale_ids,
@@ -216,11 +205,9 @@ filter_changed (CcLanguageChooser *chooser)
cc_util_normalize_casefold_and_unaccent (gtk_entry_get_text (GTK_ENTRY
(chooser->language_filter_entry)));
if (!filter_contents) {
gtk_list_box_invalidate_filter (GTK_LIST_BOX (chooser->language_listbox));
- gtk_list_box_set_placeholder (GTK_LIST_BOX (chooser->language_listbox), NULL);
return;
}
chooser->filter_words = g_strsplit_set (g_strstrip (filter_contents), " ", 0);
- gtk_list_box_set_placeholder (GTK_LIST_BOX (chooser->language_listbox), chooser->no_results);
gtk_list_box_invalidate_filter (GTK_LIST_BOX (chooser->language_listbox));
}
@@ -323,9 +310,6 @@ cc_language_chooser_init (CcLanguageChooser *chooser)
chooser->more_item = more_widget_new ();
gtk_widget_show (GTK_WIDGET (chooser->more_item));
- /* We ref-sink here so we can reuse this widget multiple times */
- chooser->no_results = g_object_ref_sink (no_results_widget_new ());
- gtk_widget_show (chooser->no_results);
gtk_list_box_set_sort_func (GTK_LIST_BOX (chooser->language_listbox),
sort_languages, chooser, NULL);
@@ -354,7 +338,6 @@ cc_language_chooser_dispose (GObject *object)
{
CcLanguageChooser *chooser = CC_LANGUAGE_CHOOSER (object);
- g_clear_object (&chooser->no_results);
g_clear_pointer (&chooser->filter_words, g_strfreev);
g_clear_pointer (&chooser->language, g_free);
diff --git a/panels/common/cc-language-chooser.ui b/panels/common/cc-language-chooser.ui
index 6b61d5520..f4946500d 100644
--- a/panels/common/cc-language-chooser.ui
+++ b/panels/common/cc-language-chooser.ui
@@ -60,6 +60,13 @@
<property name="vexpand">True</property>
<property name="halign">fill</property>
<property name="valign">fill</property>
+ <child type="placeholder">
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">No languages found</property>
+ <property name="sensitive">False</property>
+ </object>
+ </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]