diff options
author | Christopher Davis <brainblasted@disroot.org> | 2021-02-10 20:44:49 -0800 |
---|---|---|
committer | Christopher Davis <brainblasted@disroot.org> | 2021-04-15 22:38:33 +0000 |
commit | bda63b85097fa7d21f60074fc77aba4a4ce16609 (patch) | |
tree | 5e44767abb8d8d1c28424a29ff55e85fae382c6f | |
parent | 0e4959fec2db89377cf7f838a4684b2f425632b5 (diff) | |
download | gnome-logs-wip/cdavis/40-consistency-update.tar.gz |
eventviewlist: Use HdyStatusPage for list placeholderwip/cdavis/40-consistency-update
libhandy gives us a nice pre-built page to use for empty
views. To be consistent with the rest of GNOME we should
use it.
-rw-r--r-- | src/gl-eventviewlist.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/src/gl-eventviewlist.c b/src/gl-eventviewlist.c index d313c7d..8792585 100644 --- a/src/gl-eventviewlist.c +++ b/src/gl-eventviewlist.c @@ -20,6 +20,7 @@ #include <glib/gi18n.h> #include <glib-unix.h> +#include <libhandy-1/handy.h> #include <stdlib.h> #include "gl-categorylist.h" @@ -462,37 +463,18 @@ gl_event_view_list_set_search_mode (GlEventViewList *view, static GtkWidget * gl_event_view_create_empty (G_GNUC_UNUSED GlEventViewList *view) { - GtkWidget *box; - GtkStyleContext *context; - GtkWidget *image; - GtkWidget *label; - gchar *markup; - - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); - gtk_widget_set_halign (box, GTK_ALIGN_CENTER); - gtk_widget_set_hexpand (box, TRUE); - gtk_widget_set_valign (box, GTK_ALIGN_CENTER); - gtk_widget_set_vexpand (box, TRUE); - context = gtk_widget_get_style_context (box); - gtk_style_context_add_class (context, "dim-label"); - - image = gtk_image_new_from_icon_name ("action-unavailable-symbolic", 0); - context = gtk_widget_get_style_context (image); - gtk_style_context_add_class (context, "dim-label"); - gtk_image_set_pixel_size (GTK_IMAGE (image), 128); - gtk_container_add (GTK_CONTAINER (box), image); - - label = gtk_label_new (NULL); + GtkWidget *status_page; + + status_page = hdy_status_page_new (); + hdy_status_page_set_icon_name (HDY_STATUS_PAGE (status_page), + "action-unavailable-symbolic"); /* Translators: Shown when there are no (zero) results in the current * view. */ - markup = g_markup_printf_escaped ("<big>%s</big>", _("No results")); - gtk_label_set_markup (GTK_LABEL (label), markup); - gtk_container_add (GTK_CONTAINER (box), label); - g_free (markup); + hdy_status_page_set_title (HDY_STATUS_PAGE (status_page), _("No Results")); - gtk_widget_show_all (box); + gtk_widget_show (status_page); - return box; + return status_page; } static GtkWidget * |