[nautilus] Add entry icon to search bar
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus] Add entry icon to search bar
- Date: Wed, 25 Nov 2009 09:33:30 +0000 (UTC)
commit 6f0c44a70f62395e6281604601075994fa921afc
Author: Alexander Larsson <alexl redhat com>
Date: Wed Nov 25 10:32:05 2009 +0100
Add entry icon to search bar
This way you can activate a search using the mouse.
(Bug #598256)
src/nautilus-search-bar.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-search-bar.c b/src/nautilus-search-bar.c
index d5cd90b..8ed94ac 100644
--- a/src/nautilus-search-bar.c
+++ b/src/nautilus-search-bar.c
@@ -104,6 +104,15 @@ entry_has_text (NautilusSearchBar *bar)
}
static void
+entry_icon_release_cb (GtkEntry *entry,
+ GtkEntryIconPosition position,
+ GdkEvent *event,
+ NautilusSearchBar *bar)
+{
+ g_signal_emit_by_name (entry, "activate", 0);
+}
+
+static void
entry_activate_cb (GtkWidget *entry, NautilusSearchBar *bar)
{
if (entry_has_text (bar) && !bar->details->entry_borrowed) {
@@ -140,10 +149,15 @@ nautilus_search_bar_init (NautilusSearchBar *bar)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
bar->details->entry = gtk_entry_new ();
+ gtk_entry_set_icon_from_stock (GTK_ENTRY (bar->details->entry),
+ GTK_ENTRY_ICON_SECONDARY,
+ GTK_STOCK_FIND);
gtk_box_pack_start (GTK_BOX (hbox), bar->details->entry, TRUE, TRUE, 0);
g_signal_connect (bar->details->entry, "activate",
G_CALLBACK (entry_activate_cb), bar);
+ g_signal_connect (bar->details->entry, "icon-release",
+ G_CALLBACK (entry_icon_release_cb), bar);
gtk_widget_show (bar->details->entry);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]