diff options
author | monsta <[email protected]> | 2017-07-05 12:52:39 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-08-10 18:11:40 +0300 |
commit | 11cc7bfa71bbeb9711292fedd70be149729915a6 (patch) | |
tree | 9eac5e5ba1ae9173910ca524d2b1f4c45332433a /mate-volume-control/gvc-stream-status-icon.c | |
parent | 7266d5b0a8ac556d6c12bdde052af8af74f9f54d (diff) | |
download | mate-media-11cc7bfa71bbeb9711292fedd70be149729915a6.tar.bz2 mate-media-11cc7bfa71bbeb9711292fedd70be149729915a6.tar.xz |
refresh tray icon on icon theme change
Diffstat (limited to 'mate-volume-control/gvc-stream-status-icon.c')
-rw-r--r-- | mate-volume-control/gvc-stream-status-icon.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mate-volume-control/gvc-stream-status-icon.c b/mate-volume-control/gvc-stream-status-icon.c index c5f0115..e80d4fe 100644 --- a/mate-volume-control/gvc-stream-status-icon.c +++ b/mate-volume-control/gvc-stream-status-icon.c @@ -666,6 +666,15 @@ on_status_icon_visible_notify (GvcStreamStatusIcon *icon) } static void +on_icon_theme_change (GtkSettings *settings, + GParamSpec *pspec, + GvcStreamStatusIcon *icon) +{ + gtk_status_icon_set_from_icon_name (GTK_STATUS_ICON (icon), + icon->priv->icon_names[icon->priv->current_icon]); +} + +static void gvc_stream_status_icon_init (GvcStreamStatusIcon *icon) { GtkWidget *frame; @@ -745,6 +754,11 @@ gvc_stream_status_icon_init (GvcStreamStatusIcon *icon) gtk_container_add (GTK_CONTAINER (frame), box); gtk_box_pack_start (GTK_BOX (box), icon->priv->bar, TRUE, FALSE, 0); + + g_signal_connect (gtk_settings_get_default (), + "notify::gtk-icon-theme-name", + G_CALLBACK (on_icon_theme_change), + icon); } static void @@ -756,6 +770,10 @@ gvc_stream_status_icon_finalize (GObject *object) g_strfreev (icon->priv->icon_names); + g_signal_handlers_disconnect_by_func (gtk_settings_get_default (), + on_icon_theme_change, + icon); + G_OBJECT_CLASS (gvc_stream_status_icon_parent_class)->finalize (object); } |