[gnome-calendar/search-improvements] search-label: show a friendly label when search entry is empty
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/search-improvements] search-label: show a friendly label when search entry is empty
- Date: Wed, 7 Jan 2015 18:15:41 +0000 (UTC)
commit 66472d435016363682b9c774769a5872023d1a82
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Jan 7 16:15:30 2015 -0200
search-label: show a friendly label when search entry is empty
data/ui/search-view.ui | 34 ++++++++++++++++++++++++++++------
src/gcal-search-view.c | 2 ++
2 files changed, 30 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/search-view.ui b/data/ui/search-view.ui
index 78c2ad4..729ac86 100644
--- a/data/ui/search-view.ui
+++ b/data/ui/search-view.ui
@@ -67,14 +67,36 @@
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkListBox" id="listbox">
+ <object class="GtkGrid" id="search_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="selection_mode">none</property>
- <signal name="row-activated" handler="open_event" object="GcalSearchView" swapped="no"/>
- <style>
- <class name="search-list"/>
- </style>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkLabel" id="empty_search_label">
+ <property name="visible" bind-source="listbox" bind-property="visible"
bind-flags="invert-boolean | bidirectional" />
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label" translatable="yes">Use the entry above to search for
events.</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkListBox" id="listbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="selection_mode">none</property>
+ <signal name="row-activated" handler="open_event" object="GcalSearchView"
swapped="no"/>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index 0e3b11d..8a7f327 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -735,6 +735,7 @@ gcal_search_view_search (GcalSearchView *view,
}
gcal_manager_set_query (priv->manager, search_query);
+ gtk_widget_show (priv->listbox);
g_free (search_query);
}
@@ -748,6 +749,7 @@ gcal_search_view_search (GcalSearchView *view,
*/
g_hash_table_remove_all (priv->row_to_event);
g_hash_table_remove_all (priv->events);
+ gtk_widget_hide (priv->listbox);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]