search-label: show a friendly label when search entry is empty

This commit is contained in:
Georges Basile Stavracas Neto
2015-01-09 09:16:41 -05:00
committed by Erick Pérez Castellanos
parent ff54f7eb67
commit d628c4b9fc
2 changed files with 30 additions and 6 deletions
+28 -6
View File
@@ -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>
+2
View File
@@ -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);
}
}