diff options
author | Cosimo Cecchi <cosimoc@svn.gnome.org> | 2007-09-10 01:49:34 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@src.gnome.org> | 2007-09-10 01:49:34 +0800 |
commit | 0e3d0325dab1bfa25b1af72cc8b1f8dcddfa9dc7 (patch) | |
tree | b3be6fb6aa486e4b971e2d45bbab67df012df5d9 /lib | |
parent | 56a321d56e13c6ba2b635e2b2066d4337a5046ad (diff) | |
download | gsoc2013-epiphany-0e3d0325dab1bfa25b1af72cc8b1f8dcddfa9dc7.tar.gz gsoc2013-epiphany-0e3d0325dab1bfa25b1af72cc8b1f8dcddfa9dc7.tar.zst gsoc2013-epiphany-0e3d0325dab1bfa25b1af72cc8b1f8dcddfa9dc7.zip |
Modifies the EphySearchEntry to inherit from EphyIconEntry instead of
2007-09-09 Cosimo Cecchi <cosimoc@svn.gnome.org>
* lib/widgets/ephy-search-entry.c: (ephy_search_entry_get_type),
(ephy_search_entry_timeout_cb), (ephy_search_entry_changed_cb),
(ephy_search_entry_init), (ephy_search_entry_clear):
* lib/widgets/ephy-search-entry.h:
* src/bookmarks/ephy-bookmarks-editor.c: (search_entry_clear_cb),
(build_search_box):
Modifies the EphySearchEntry to inherit from EphyIconEntry instead of
GtkEntry, to have icons on it. Adds a cleaner icon in the search
entry of Bookmarks Editor. Fixes bug #463469.
svn path=/trunk/; revision=7358
Diffstat (limited to 'lib')
-rw-r--r-- | lib/widgets/ephy-search-entry.c | 18 | ||||
-rw-r--r-- | lib/widgets/ephy-search-entry.h | 6 |
2 files changed, 16 insertions, 8 deletions
diff --git a/lib/widgets/ephy-search-entry.c b/lib/widgets/ephy-search-entry.c index 5d8330770..efb7a15e3 100644 --- a/lib/widgets/ephy-search-entry.c +++ b/lib/widgets/ephy-search-entry.c @@ -21,6 +21,7 @@ #include "config.h" #include <gtk/gtklabel.h> +#include <gtk/gtkentry.h> #include <glib/gi18n.h> #include <string.h> @@ -68,7 +69,7 @@ ephy_search_entry_get_type (void) (GInstanceInitFunc) ephy_search_entry_init }; - type = g_type_register_static (GTK_TYPE_ENTRY, + type = g_type_register_static (EPHY_TYPE_ICON_ENTRY, "EphySearchEntry", &our_info, 0); } @@ -101,7 +102,8 @@ static gboolean ephy_search_entry_timeout_cb (EphySearchEntry *entry) { g_signal_emit (G_OBJECT (entry), ephy_search_entry_signals[SEARCH], 0, - gtk_entry_get_text (GTK_ENTRY (entry))); + gtk_entry_get_text (GTK_ENTRY (ephy_icon_entry_get_entry + (EPHY_ICON_ENTRY (entry))))); entry->priv->timeout = 0; return FALSE; @@ -112,7 +114,12 @@ ephy_search_entry_changed_cb (GtkEditable *editable, EphySearchEntry *entry) { if (entry->priv->clearing == TRUE) + { + g_signal_emit (G_OBJECT (entry), ephy_search_entry_signals[SEARCH], 0, + gtk_entry_get_text (GTK_ENTRY (ephy_icon_entry_get_entry + (EPHY_ICON_ENTRY (entry))))); return; + } if (entry->priv->timeout != 0) { @@ -139,11 +146,11 @@ ephy_search_entry_init (EphySearchEntry *entry) { entry->priv = EPHY_SEARCH_ENTRY_GET_PRIVATE (entry); - g_signal_connect (G_OBJECT (entry), + g_signal_connect (ephy_icon_entry_get_entry (EPHY_ICON_ENTRY (entry)), "destroy", G_CALLBACK (ephy_search_entry_destroy_cb), entry); - g_signal_connect (G_OBJECT (entry), + g_signal_connect (ephy_icon_entry_get_entry (EPHY_ICON_ENTRY (entry)), "changed", G_CALLBACK (ephy_search_entry_changed_cb), entry); @@ -171,7 +178,8 @@ ephy_search_entry_clear (EphySearchEntry *entry) entry->priv->clearing = TRUE; - gtk_entry_set_text (GTK_ENTRY (entry), ""); + gtk_entry_set_text (GTK_ENTRY (ephy_icon_entry_get_entry + (EPHY_ICON_ENTRY (entry))), ""); entry->priv->clearing = FALSE; } diff --git a/lib/widgets/ephy-search-entry.h b/lib/widgets/ephy-search-entry.h index 3ffd2f47e..abb90cc47 100644 --- a/lib/widgets/ephy-search-entry.h +++ b/lib/widgets/ephy-search-entry.h @@ -21,7 +21,7 @@ #ifndef EPHY_SEARCH_ENTRY_H #define EPHY_SEARCH_ENTRY_H -#include <gtk/gtkentry.h> +#include "ephy-icon-entry.h" G_BEGIN_DECLS @@ -38,7 +38,7 @@ typedef struct _EphySearchEntryClass EphySearchEntryClass; struct _EphySearchEntry { - GtkEntry parent; + EphyIconEntry parent; /*< private >*/ EphySearchEntryPrivate *priv; @@ -46,7 +46,7 @@ struct _EphySearchEntry struct _EphySearchEntryClass { - GtkEntryClass parent; + EphyIconEntryClass parent; void (*search) (EphySearchEntry *view, const char *text); }; |