search-view: implemented no results page

This commit is contained in:
Georges Basile Stavracas Neto
2015-01-09 08:36:16 -05:00
committed by Erick Pérez Castellanos
parent f937489dcd
commit ab1374d8cd
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -51,6 +51,7 @@
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">24</property>
<child>
<object class="GtkImage" id="image">
<property name="visible">True</property>
+8
View File
@@ -32,6 +32,7 @@
typedef struct
{
GtkWidget *listbox;
GtkWidget *frame;
GtkWidget *no_results_grid;
/* misc */
@@ -252,6 +253,7 @@ gcal_search_view_class_init (GcalSearchViewClass *klass)
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/calendar/search-view.ui");
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GcalSearchView, no_results_grid);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GcalSearchView, frame);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GcalSearchView, listbox);
}
@@ -403,6 +405,9 @@ gcal_search_view_component_added (ECalDataModelSubscriber *subscriber,
grid = make_grid_for_event (GCAL_SEARCH_VIEW (subscriber), GCAL_EVENT_WIDGET (event));
gtk_container_add (GTK_CONTAINER (priv->listbox), grid);
priv->num_results++;
gtk_widget_set_visible (priv->frame, priv->num_results != 0);
gtk_widget_set_visible (priv->no_results_grid, priv->num_results == 0);
}
static void
@@ -454,6 +459,9 @@ gcal_search_view_component_removed (ECalDataModelSubscriber *subscriber,
g_list_free (children);
priv->num_results--;
gtk_widget_set_visible (priv->frame, priv->num_results != 0);
gtk_widget_set_visible (priv->no_results_grid, priv->num_results == 0);
}
static void