[gnome-calendar/search-improvements] search-view: implemented no results page
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/search-improvements] search-view: implemented no results page
- Date: Sun, 4 Jan 2015 02:02:40 +0000 (UTC)
commit 473376d5e98a91df67cf89c7ca8ea473251fbb2a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun Jan 4 00:02:32 2015 -0200
search-view: implemented no results page
data/ui/search-view.ui | 1 +
src/gcal-search-view.c | 8 ++++++++
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/data/ui/search-view.ui b/data/ui/search-view.ui
index 0fa7b86..77f577a 100644
--- a/data/ui/search-view.ui
+++ b/data/ui/search-view.ui
@@ -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>
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index bb45e1c..9ddd129 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]