[gnome-software: 3/7] repos-dialog: Use HdyStatusPage for the empty state
- From: Tobias Bernard <tbernard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 3/7] repos-dialog: Use HdyStatusPage for the empty state
- Date: Tue, 10 Aug 2021 11:26:13 +0000 (UTC)
commit 1167dda8281e70fc56993d4449a325f6fb49eac5
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri Jul 30 10:09:52 2021 +0200
repos-dialog: Use HdyStatusPage for the empty state
src/gs-repos-dialog.c | 6 +++---
src/gs-repos-dialog.ui | 41 +++--------------------------------------
2 files changed, 6 insertions(+), 41 deletions(-)
---
diff --git a/src/gs-repos-dialog.c b/src/gs-repos-dialog.c
index 4571baa38..554d7d61b 100644
--- a/src/gs-repos-dialog.c
+++ b/src/gs-repos-dialog.c
@@ -30,7 +30,7 @@ struct _GsReposDialog
GCancellable *cancellable;
GsPluginLoader *plugin_loader;
- GtkWidget *label_empty;
+ GtkWidget *status_empty;
GtkWidget *label_header;
GtkWidget *content_box;
GtkWidget *spinner;
@@ -665,7 +665,7 @@ gs_repos_dialog_init (GsReposDialog *dialog)
%s gets replaced by the name of the actual distro, e.g. Fedora. */
label_empty_text = g_strdup_printf (_("These repositories supplement the default software provided by
%s."),
os_name);
- gtk_label_set_text (GTK_LABEL (dialog->label_empty), label_empty_text);
+ hdy_status_page_set_description (HDY_STATUS_PAGE (dialog->status_empty), label_empty_text);
}
static void
@@ -678,7 +678,7 @@ gs_repos_dialog_class_init (GsReposDialogClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-repos-dialog.ui");
- gtk_widget_class_bind_template_child (widget_class, GsReposDialog, label_empty);
+ gtk_widget_class_bind_template_child (widget_class, GsReposDialog, status_empty);
gtk_widget_class_bind_template_child (widget_class, GsReposDialog, label_header);
gtk_widget_class_bind_template_child (widget_class, GsReposDialog, content_box);
gtk_widget_class_bind_template_child (widget_class, GsReposDialog, spinner);
diff --git a/src/gs-repos-dialog.ui b/src/gs-repos-dialog.ui
index 2bd2b5283..543e3e9ae 100644
--- a/src/gs-repos-dialog.ui
+++ b/src/gs-repos-dialog.ui
@@ -47,45 +47,10 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="box_empty">
+ <object class="HdyStatusPage" id="status_empty">
<property name="visible">True</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="spacing">16</property>
- <property name="orientation">vertical</property>
- <style>
- <class name="dim-label"/>
- </style>
- <child>
- <object class="GtkImage" id="icon_empty">
- <property name="visible">True</property>
- <property name="icon_name">org.gnome.Software-symbolic</property>
- <property name="pixel-size">64</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label_empty_title">
- <property name="visible">True</property>
- <property name="justify">center</property>
- <property name="wrap">True</property>
- <property name="label" translatable="yes">No Repositories</property>
- <property name="max_width_chars">40</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label_empty">
- <property name="visible">True</property>
- <property name="justify">center</property>
- <property name="wrap">True</property>
- <property name="max_width_chars">40</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- </object>
- </child>
+ <property name="icon_name">org.gnome.Software-symbolic</property>
+ <property name="title" translatable="yes">No Repositories</property>
</object>
<packing>
<property name="name">empty</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]