144
144
static void client_menu_changed (GtkWidget *widget, GtkWidget *child, AppIndicator *indicator);
145
145
static void submenu_changed (GtkWidget *widget, GtkWidget *child, gpointer data);
147
static void theme_changed_cb (GtkIconTheme * theme, gpointer user_data);
147
149
/* GObject type */
148
150
G_DEFINE_TYPE (AppIndicator, app_indicator, G_TYPE_OBJECT);
336
338
dbus_g_connection_ref(priv->connection);
340
g_signal_connect(G_OBJECT(gtk_icon_theme_get_default()),
341
"changed", G_CALLBACK(theme_changed_cb), self);
338
343
self->priv = priv;
820
/* emit a NEW_ICON signal in response for the theme change */
822
theme_changed_cb (GtkIconTheme * theme, gpointer user_data)
824
g_signal_emit (user_data, signals[NEW_ICON], 0, TRUE);
815
827
/* Creates a StatusIcon that can be used when the application
816
828
indicator area isn't available. */
817
829
static GtkStatusIcon *
849
861
status_icon_changes (AppIndicator * self, gpointer data)
851
863
GtkStatusIcon * icon = GTK_STATUS_ICON(data);
864
GIcon *themed_icon = NULL;
853
866
switch (app_indicator_get_status(self)) {
854
867
case APP_INDICATOR_STATUS_PASSIVE:
869
g_themed_icon_new_with_default_fallbacks (app_indicator_get_icon (self));
855
870
gtk_status_icon_set_visible(icon, FALSE);
856
gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self));
871
gtk_status_icon_set_from_gicon(icon, themed_icon);
858
873
case APP_INDICATOR_STATUS_ACTIVE:
859
gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self));
875
g_themed_icon_new_with_default_fallbacks (app_indicator_get_icon (self));
876
gtk_status_icon_set_from_gicon(icon, themed_icon);
860
877
gtk_status_icon_set_visible(icon, TRUE);
862
879
case APP_INDICATOR_STATUS_ATTENTION:
863
gtk_status_icon_set_from_icon_name(icon, app_indicator_get_attention_icon(self));
881
g_themed_icon_new_with_default_fallbacks (app_indicator_get_attention_icon (self));
882
gtk_status_icon_set_from_gicon(icon, themed_icon);
864
883
gtk_status_icon_set_visible(icon, TRUE);
888
g_object_unref (themed_icon);