aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2008-12-31 06:32:55 +0800
committerXan Lopez <xan@src.gnome.org>2008-12-31 06:32:55 +0800
commit48d5d818763a02134170f93b5a0e3ee04ae3fff1 (patch)
treef0f166be6ae6b2661782f7a3be5aa2876a4beebb /src
parent530d9f4f4056b57d0a90456aee036a4e61e6f7be (diff)
downloadgsoc2013-epiphany-48d5d818763a02134170f93b5a0e3ee04ae3fff1.tar
gsoc2013-epiphany-48d5d818763a02134170f93b5a0e3ee04ae3fff1.tar.gz
gsoc2013-epiphany-48d5d818763a02134170f93b5a0e3ee04ae3fff1.tar.bz2
gsoc2013-epiphany-48d5d818763a02134170f93b5a0e3ee04ae3fff1.tar.lz
gsoc2013-epiphany-48d5d818763a02134170f93b5a0e3ee04ae3fff1.tar.xz
gsoc2013-epiphany-48d5d818763a02134170f93b5a0e3ee04ae3fff1.tar.zst
gsoc2013-epiphany-48d5d818763a02134170f93b5a0e3ee04ae3fff1.zip
Port EphySearchEntry to use GtkEntry.
Also fold into the widget the 'clear' icon instead of creating it twice outside. svn path=/trunk/; revision=8653
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c17
-rw-r--r--src/ephy-history-window.c38
2 files changed, 1 insertions, 54 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 403c21f33..4175dec1f 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -1604,8 +1604,6 @@ build_search_box (EphyBookmarksEditor *editor)
GtkWidget *box;
GtkWidget *label;
GtkWidget *entry;
- GtkWidget *cleaner;
- GtkWidget *ebox;
char *str;
box = gtk_hbox_new (FALSE, 6);
@@ -1615,21 +1613,6 @@ build_search_box (EphyBookmarksEditor *editor)
entry = ephy_search_entry_new ();
editor->priv->search_entry = entry;
- cleaner = gtk_image_new_from_stock (GTK_STOCK_CLEAR,
- GTK_ICON_SIZE_MENU);
- ebox = gtk_event_box_new ();
- gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE);
-
- gtk_widget_add_events (ebox, GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK);
- g_signal_connect (ebox , "button-release-event",
- G_CALLBACK (search_entry_clear_cb),
- entry);
- gtk_widget_set_tooltip_text (ebox,
- _("Clear"));
- gtk_container_add (GTK_CONTAINER (ebox), cleaner);
- ephy_icon_entry_pack_widget ((EPHY_ICON_ENTRY (entry)), ebox, FALSE);
-
g_signal_connect (G_OBJECT (entry), "search",
G_CALLBACK (search_entry_search_cb),
editor);
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 961828067..d38493ca3 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -916,8 +916,7 @@ add_by_word_filter (EphyHistoryWindow *editor, EphyNodeFilter *filter, int level
{
const char *search_text;
- search_text = gtk_entry_get_text (GTK_ENTRY (ephy_icon_entry_get_entry
- (EPHY_ICON_ENTRY (editor->priv->search_entry))));
+ search_text = gtk_entry_get_text (GTK_ENTRY (editor->priv->search_entry));
if (search_text == NULL) return;
ephy_node_filter_add_expression
@@ -1017,31 +1016,11 @@ time_combo_changed_cb (GtkWidget *combo, EphyHistoryWindow *editor)
setup_filters (editor, TRUE, TRUE);
}
-static gboolean
-search_entry_clear_cb (GtkWidget *ebox,
- GdkEventButton *event,
- GtkWidget *entry)
-{
- guint state = event->state & gtk_accelerator_get_default_mod_mask ();
-
- if (event->type == GDK_BUTTON_RELEASE &&
- event->button == 1 /* left */ &&
- state == 0)
- {
- ephy_search_entry_clear (EPHY_SEARCH_ENTRY (entry));
-
- return TRUE;
- }
-
- return FALSE;
-}
-
static GtkWidget *
build_search_box (EphyHistoryWindow *editor)
{
GtkWidget *box, *label, *entry;
GtkWidget *combo;
- GtkWidget *cleaner, *ebox;
char *str;
int time_range;
@@ -1054,21 +1033,6 @@ build_search_box (EphyHistoryWindow *editor)
add_entry_monitor (editor, entry);
editor->priv->search_entry = entry;
- cleaner = gtk_image_new_from_stock (GTK_STOCK_CLEAR,
- GTK_ICON_SIZE_MENU);
- ebox = gtk_event_box_new ();
- gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE);
-
- gtk_widget_add_events (ebox, GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK);
- g_signal_connect (ebox , "button-release-event",
- G_CALLBACK (search_entry_clear_cb),
- entry);
- gtk_widget_set_tooltip_text (ebox,
- _("Clear"));
- gtk_container_add (GTK_CONTAINER (ebox), cleaner);
- ephy_icon_entry_pack_widget ((EPHY_ICON_ENTRY (entry)), ebox, FALSE);
-
gtk_widget_show_all (entry);
label = gtk_label_new (NULL);