[gnome-control-center/extensible-shell] shell: add a clear button the the search entry
- From: Thomas Wood <thos src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/extensible-shell] shell: add a clear button the the search entry
- Date: Wed, 24 Feb 2010 16:40:53 +0000 (UTC)
commit ff713287c80c7f6ddf774933b6f8792da132ee5c
Author: Thomas Wood <thomas wood intel com>
Date: Wed Feb 24 16:40:30 2010 +0000
shell: add a clear button the the search entry
shell/control-center.c | 9 +++++++++
shell/shell.ui | 3 +++
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/shell/control-center.c b/shell/control-center.c
index 17985c6..059c212 100644
--- a/shell/control-center.c
+++ b/shell/control-center.c
@@ -576,6 +576,13 @@ notebook_switch_page_cb (GtkNotebook *book,
gtk_widget_show (W (data->builder, "home-button"));
}
+static void
+search_entry_clear_cb (GtkEntry *entry)
+{
+ gtk_entry_set_text (entry, "");
+}
+
+
int
main (int argc, char **argv)
{
@@ -623,6 +630,8 @@ main (int argc, char **argv)
g_signal_connect (widget, "key-press-event",
G_CALLBACK (search_entry_key_press_event_cb), data);
+ g_signal_connect (widget, "icon-release", G_CALLBACK (search_entry_clear_cb), data);
+
load_panel_plugins (data);
gtk_widget_show_all (data->window);
diff --git a/shell/shell.ui b/shell/shell.ui
index 69620da..9e53343 100644
--- a/shell/shell.ui
+++ b/shell/shell.ui
@@ -46,6 +46,9 @@
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="primary_icon_stock">gtk-find</property>
+ <property name="secondary_icon_stock">gtk-clear</property>
+ <property name="secondary_icon_activatable">True</property>
+ <property name="secondary_icon_sensitive">True</property>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]