aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-09-17 12:48:46 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2011-09-20 03:10:22 +0800
commit0d24698c022b0050a6fbcd2803c93b12e8b9756a (patch)
tree183a2c2c9b3d9ebd11442b3d886dc59321412ace /libempathy-gtk
parent7323ce34c1228d04cfe3503eb818b8fac7fd4a2c (diff)
downloadgsoc2013-empathy-0d24698c022b0050a6fbcd2803c93b12e8b9756a.tar
gsoc2013-empathy-0d24698c022b0050a6fbcd2803c93b12e8b9756a.tar.gz
gsoc2013-empathy-0d24698c022b0050a6fbcd2803c93b12e8b9756a.tar.bz2
gsoc2013-empathy-0d24698c022b0050a6fbcd2803c93b12e8b9756a.tar.lz
gsoc2013-empathy-0d24698c022b0050a6fbcd2803c93b12e8b9756a.tar.xz
gsoc2013-empathy-0d24698c022b0050a6fbcd2803c93b12e8b9756a.tar.zst
gsoc2013-empathy-0d24698c022b0050a6fbcd2803c93b12e8b9756a.zip
log-window: improve icons in the search entry
There are a few improvements we can make to the search entry icons in the log window, which this patch tries to fix. - icons in entries are usually symbolic in GNOME 3, so I made the icons symbolic. - I merged the two icons in just one on the right using the shell-style, i.e. the search icon turns into a clear action once there's some text typed into the entry (Documents also uses the same style for its search entry). https://bugzilla.gnome.org/show_bug.cgi?id=659298
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-log-window.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 9ef1e16f5..cc3a90614 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -703,10 +703,10 @@ empathy_log_window_init (EmpathyLogWindow *self)
vbox = gtk_vbox_new (FALSE, 3);
self->priv->search_entry = gtk_entry_new ();
- gtk_entry_set_icon_from_stock (GTK_ENTRY (self->priv->search_entry),
- GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND);
- gtk_entry_set_icon_from_stock (GTK_ENTRY (self->priv->search_entry),
- GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (self->priv->search_entry),
+ GTK_ENTRY_ICON_SECONDARY, "edit-find-symbolic");
+ gtk_entry_set_icon_sensitive (GTK_ENTRY (self->priv->search_entry),
+ GTK_ENTRY_ICON_SECONDARY, FALSE);
label = gtk_label_new (_("Search"));
@@ -2025,6 +2025,25 @@ static void
log_window_search_entry_changed_cb (GtkWidget *entry,
EmpathyLogWindow *self)
{
+ const gchar *str;
+
+ str = gtk_entry_get_text (GTK_ENTRY (self->priv->search_entry));
+
+ if (!tp_str_empty (str))
+ {
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (self->priv->search_entry),
+ GTK_ENTRY_ICON_SECONDARY, "edit-clear-symbolic");
+ gtk_entry_set_icon_sensitive (GTK_ENTRY (self->priv->search_entry),
+ GTK_ENTRY_ICON_SECONDARY, TRUE);
+ }
+ else
+ {
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (self->priv->search_entry),
+ GTK_ENTRY_ICON_SECONDARY, "edit-find-symbolic");
+ gtk_entry_set_icon_sensitive (GTK_ENTRY (self->priv->search_entry),
+ GTK_ENTRY_ICON_SECONDARY, FALSE);
+ }
+
if (self->priv->source != 0)
g_source_remove (self->priv->source);
self->priv->source = g_timeout_add (500, (GSourceFunc) start_find_search,