[Rhythmbox-devel] pet peeve
- From: Bastien Nocera <hadess hadess net>
- To: Rhythmbox Dev <rhythmbox-devel gnome org>
- Subject: [Rhythmbox-devel] pet peeve
- Date: Mon, 17 Nov 2003 00:09:44 +0000
Eeek, no clear button for the search. I want my clear button like in
Evolution!
Patch attached :)
---
Bastien Nocera <hadess@hadess.net>
Her eyes were like two brown circles with big black dots in the centre.
Index: rb-search-entry.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-search-entry.c,v
retrieving revision 1.1
diff -u -r1.1 rb-search-entry.c
--- rb-search-entry.c 29 Sep 2003 13:48:30 -0000 1.1
+++ rb-search-entry.c 17 Nov 2003 00:08:43 -0000
@@ -23,6 +23,7 @@
#include <gtk/gtklabel.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkentry.h>
+#include <gtk/gtkbutton.h>
#include <config.h>
#include <libgnome/gnome-i18n.h>
#include <string.h>
@@ -32,6 +33,7 @@
static void rb_search_entry_class_init (RBSearchEntryClass *klass);
static void rb_search_entry_init (RBSearchEntry *entry);
static void rb_search_entry_finalize (GObject *object);
+static void rb_search_entry_empty (RBSearchEntry *entry);
static gboolean rb_search_entry_timeout_cb (RBSearchEntry *entry);
static void rb_search_entry_changed_cb (GtkEditable *editable,
RBSearchEntry *entry);
@@ -110,7 +112,7 @@
static void
rb_search_entry_init (RBSearchEntry *entry)
{
- GtkWidget *label;
+ GtkWidget *label, *button;
entry->priv = g_new0 (RBSearchEntryPrivate, 1);
@@ -126,6 +128,11 @@
gtk_box_pack_start (GTK_BOX (entry), entry->priv->entry, TRUE, TRUE, 0);
+ button = gtk_button_new_with_mnemonic (_("_Clear"));
+ gtk_box_pack_start (GTK_BOX (entry), button, FALSE, FALSE, 0);
+ g_signal_connect_swapped (G_OBJECT (button), "clicked",
+ G_CALLBACK (rb_search_entry_empty), entry);
+
g_signal_connect (G_OBJECT (entry->priv->entry),
"changed",
G_CALLBACK (rb_search_entry_changed_cb),
@@ -180,6 +187,12 @@
gtk_entry_set_text (GTK_ENTRY (entry->priv->entry), "");
entry->priv->clearing = FALSE;
+}
+
+static void
+rb_search_entry_empty (RBSearchEntry *entry)
+{
+ gtk_entry_set_text (GTK_ENTRY (entry->priv->entry), "");
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]