[devhelp/wip/swilmet/various-code-improvements] sidebar: various code improvements
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp/wip/swilmet/various-code-improvements] sidebar: various code improvements
- Date: Fri, 9 Oct 2015 17:29:07 +0000 (UTC)
commit 1d2e43b78bcb3aeedc3ec017efcf42ab5005cc2e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Oct 9 19:17:58 2015 +0200
sidebar: various code improvements
src/dh-sidebar.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/dh-sidebar.c b/src/dh-sidebar.c
index f2f4008..6d653ad 100644
--- a/src/dh-sidebar.c
+++ b/src/dh-sidebar.c
@@ -279,16 +279,14 @@ sidebar_entry_changed_cb (GtkEntry *entry,
{
DhSidebarPrivate *priv = dh_sidebar_get_instance_private (sidebar);
- /* If search entry is empty, hide the hitlist */
- if (strcmp (gtk_entry_get_text (entry), "") == 0) {
+ if (gtk_entry_get_text_length (entry) == 0) {
gtk_widget_hide (GTK_WIDGET (priv->sw_hitlist));
gtk_widget_show (GTK_WIDGET (priv->sw_book_tree));
- return;
+ } else {
+ gtk_widget_hide (GTK_WIDGET (priv->sw_book_tree));
+ gtk_widget_show (GTK_WIDGET (priv->sw_hitlist));
+ sidebar_search_run_idle (sidebar);
}
-
- gtk_widget_hide (GTK_WIDGET (priv->sw_book_tree));
- gtk_widget_show (GTK_WIDGET (priv->sw_hitlist));
- sidebar_search_run_idle (sidebar);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]