Use same clear icon handling in findbar and panels

This commit is contained in:
Christian Dywan 2012-01-14 00:45:01 +01:00
parent c0e0bee467
commit fb2e4eea77
3 changed files with 3 additions and 14 deletions

View file

@ -925,11 +925,7 @@ midori_bookmarks_init (MidoriBookmarks* bookmarks)
gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry), gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
GTK_ICON_ENTRY_PRIMARY, GTK_ICON_ENTRY_PRIMARY,
GTK_STOCK_FIND); GTK_STOCK_FIND);
gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry), sokoke_entry_set_clear_button_visible (GTK_ENTRY (entry), TRUE);
GTK_ICON_ENTRY_SECONDARY,
GTK_STOCK_CLEAR);
gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
GTK_ICON_ENTRY_SECONDARY, TRUE);
g_signal_connect (entry, "icon-release", g_signal_connect (entry, "icon-release",
G_CALLBACK (midori_bookmarks_filter_entry_clear_cb), bookmarks); G_CALLBACK (midori_bookmarks_filter_entry_clear_cb), bookmarks);
g_signal_connect (entry, "changed", g_signal_connect (entry, "changed",

View file

@ -945,12 +945,7 @@ midori_history_init (MidoriHistory* history)
gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry), gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
GTK_ICON_ENTRY_PRIMARY, GTK_ICON_ENTRY_PRIMARY,
GTK_STOCK_FIND); GTK_STOCK_FIND);
gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry), sokoke_entry_set_clear_button_visible (GTK_ENTRY (entry), TRUE);
GTK_ICON_ENTRY_SECONDARY,
GTK_STOCK_CLEAR);
gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
GTK_ICON_ENTRY_SECONDARY,
TRUE);
g_signal_connect (entry, "icon-release", g_signal_connect (entry, "icon-release",
G_CALLBACK (midori_history_filter_entry_clear_cb), history); G_CALLBACK (midori_history_filter_entry_clear_cb), history);
g_signal_connect (entry, "changed", g_signal_connect (entry, "changed",

View file

@ -112,7 +112,6 @@ midori_findbar_entry_clear_icon_released_cb (GtkIconEntry* entry,
{ {
if (icon_pos == GTK_ICON_ENTRY_SECONDARY) if (icon_pos == GTK_ICON_ENTRY_SECONDARY)
{ {
gtk_entry_set_text (GTK_ENTRY (entry), "");
midori_findbar_set_icon (findbar, GTK_ICON_ENTRY_PRIMARY, "edit-find"); midori_findbar_set_icon (findbar, GTK_ICON_ENTRY_PRIMARY, "edit-find");
} }
} }
@ -265,8 +264,7 @@ midori_findbar_init (MidoriFindbar* findbar)
gtk_toolbar_insert (GTK_TOOLBAR (findbar), toolitem, -1); gtk_toolbar_insert (GTK_TOOLBAR (findbar), toolitem, -1);
findbar->find_text = gtk_icon_entry_new (); findbar->find_text = gtk_icon_entry_new ();
midori_findbar_set_icon (findbar, GTK_ICON_ENTRY_PRIMARY, "edit-find"); midori_findbar_set_icon (findbar, GTK_ICON_ENTRY_PRIMARY, "edit-find");
gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (findbar->find_text), sokoke_entry_set_clear_button_visible (GTK_ENTRY (findbar->find_text), TRUE);
GTK_ICON_ENTRY_SECONDARY, TRUE);
g_signal_connect (findbar->find_text, "icon-release", g_signal_connect (findbar->find_text, "icon-release",
G_CALLBACK (midori_findbar_entry_clear_icon_released_cb), findbar); G_CALLBACK (midori_findbar_entry_clear_icon_released_cb), findbar);
g_signal_connect (findbar->find_text, "activate", g_signal_connect (findbar->find_text, "activate",