[yelp: 6/17] yelp-location-entry: Improvements for search entries
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp: 6/17] yelp-location-entry: Improvements for search entries
- Date: Sun, 13 Feb 2011 22:29:24 +0000 (UTC)
commit fa6ab9410105bb5e6753254e1ce2cb2ca3eb0d9f
Author: Shaun McCance <shaunm gnome org>
Date: Fri Feb 11 16:02:14 2011 -0500
yelp-location-entry: Improvements for search entries
I should merge/finish my symbolic icon work on master before
taking this any further, because matching on icon names isn't
going to work with that.
libyelp/yelp-location-entry.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libyelp/yelp-location-entry.c b/libyelp/yelp-location-entry.c
index 8af9026..3725015 100644
--- a/libyelp/yelp-location-entry.c
+++ b/libyelp/yelp-location-entry.c
@@ -619,6 +619,7 @@ location_entry_search_activated (YelpLocationEntry *entry)
gtk_entry_get_text (GTK_ENTRY (priv->text_entry)));
g_object_unref (base);
yelp_view_load_uri (priv->view, uri);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->view));
}
static void
@@ -652,7 +653,10 @@ location_entry_start_search (YelpLocationEntry *entry,
if (!priv->enable_search)
return;
if (clear && !priv->search_mode) {
- gtk_entry_set_text (GTK_ENTRY (priv->text_entry), "");
+ const gchar *icon = gtk_entry_get_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_PRIMARY);
+ if (!g_str_equal (icon, "folder-saved-search"))
+ gtk_entry_set_text (GTK_ENTRY (priv->text_entry), "");
}
priv->search_mode = TRUE;
location_entry_set_entry (entry, FALSE);
@@ -681,6 +685,7 @@ location_entry_cancel_search (YelpLocationEntry *entry)
priv->completion);
g_object_unref (priv->completion);
}
+ gtk_editable_select_region (GTK_EDITABLE (priv->text_entry), 0, 0);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]