diff options
author | monsta <[email protected]> | 2017-07-05 12:52:39 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-07-05 12:52:39 +0300 |
commit | 7ee1fca30ddb23e619429fd8cbfe2c936ace6f35 (patch) | |
tree | 47f84fc33456ca1d508100729fae2cfaba1d8570 /mate-volume-control/gvc-stream-status-icon.c | |
parent | 4f2727bbab238e9f84f7951f4e21327b43235286 (diff) | |
download | mate-media-7ee1fca30ddb23e619429fd8cbfe2c936ace6f35.tar.bz2 mate-media-7ee1fca30ddb23e619429fd8cbfe2c936ace6f35.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); } |