aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-02-26 22:04:00 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-02-28 02:52:46 +0800
commit96f6ab994f7631af1a478f0f625357976195ace0 (patch)
tree02bc67db578bd770df855fe766aa74a00a997955 /libempathy-gtk
parenta8afec3bb227e3a04a3cbb4d6b14f5ba5882654a (diff)
downloadgsoc2013-empathy-96f6ab994f7631af1a478f0f625357976195ace0.tar
gsoc2013-empathy-96f6ab994f7631af1a478f0f625357976195ace0.tar.gz
gsoc2013-empathy-96f6ab994f7631af1a478f0f625357976195ace0.tar.bz2
gsoc2013-empathy-96f6ab994f7631af1a478f0f625357976195ace0.tar.lz
gsoc2013-empathy-96f6ab994f7631af1a478f0f625357976195ace0.tar.xz
gsoc2013-empathy-96f6ab994f7631af1a478f0f625357976195ace0.tar.zst
gsoc2013-empathy-96f6ab994f7631af1a478f0f625357976195ace0.zip
presence-chooser: Grey the 'favorite' icon when the status is not a favorite
This is more coherent as the favorite icon is now theme dependent and fix the problem that the old unstarred icon was not really visible (#584629).
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index 64aa79799..ee92829fc 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -111,6 +111,7 @@ typedef struct {
PresenceChooserEntryType previous_type;
TpAccountManager *account_manager;
+ GdkPixbuf *not_favorite_pixbuf;
} EmpathyPresenceChooserPriv;
/* States to be listed in the menu.
@@ -327,6 +328,7 @@ presence_chooser_is_preset (EmpathyPresenceChooser *self)
static void
presence_chooser_set_favorite_icon (EmpathyPresenceChooser *self)
{
+ EmpathyPresenceChooserPriv *priv = GET_PRIV (self);
GtkWidget *entry;
PresenceChooserEntryType type;
@@ -345,9 +347,9 @@ presence_chooser_set_favorite_icon (EmpathyPresenceChooser *self)
}
else {
/* custom entries can be favorited */
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
+ gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (entry),
GTK_ENTRY_ICON_SECONDARY,
- "empathy-unstarred");
+ priv->not_favorite_pixbuf);
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
GTK_ENTRY_ICON_SECONDARY,
_("Click to make this status a favorite"));
@@ -807,6 +809,22 @@ presence_chooser_connectivity_state_change (EmpathyConnectivity *connectivity,
presence_chooser_update_sensitivity (chooser);
}
+/* Create a greyed version of the 'favorite' icon */
+static GdkPixbuf *
+create_not_favorite_pixbuf (void)
+{
+ GdkPixbuf *favorite, *result;
+
+ favorite = empathy_pixbuf_from_icon_name ("emblem-favorite",
+ GTK_ICON_SIZE_MENU);
+
+ result = gdk_pixbuf_copy (favorite);
+ gdk_pixbuf_saturate_and_pixelate (favorite, result, 1.0, TRUE);
+
+ g_object_unref (favorite);
+ return result;
+}
+
static void
empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
{
@@ -817,6 +835,10 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
chooser->priv = priv;
+ /* Create the not-favorite icon */
+ priv->not_favorite_pixbuf = create_not_favorite_pixbuf ();
+ g_assert (priv->not_favorite_pixbuf != NULL);
+
presence_chooser_create_model (chooser);
gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (chooser),
@@ -924,6 +946,7 @@ presence_chooser_finalize (GObject *object)
g_object_unref (priv->idle);
g_object_unref (priv->connectivity);
+ g_object_unref (priv->not_favorite_pixbuf);
G_OBJECT_CLASS (empathy_presence_chooser_parent_class)->finalize (object);
}