We have to call the callback manually to update the theme when it's changed.
Also make sure that style-set signal is only connected once and we update the
theme only if the 'simple' one is used.
https://bugzilla.gnome.org/show_bug.cgi?id=664795
+static void on_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, EmpathyThemeManager *self);
+
static EmpathyThemeBoxes *
theme_manager_create_boxes_view (EmpathyThemeManager *manager)
{
static EmpathyThemeBoxes *
theme_manager_create_boxes_view (EmpathyThemeManager *manager)
{
theme_manager_view_weak_notify_cb,
&priv->boxes_views);
theme_manager_view_weak_notify_cb,
&priv->boxes_views);
+ g_signal_connect (G_OBJECT (theme), "style-set",
+ G_CALLBACK (on_style_set_cb), manager);
+
-on_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, gpointer data)
+on_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, EmpathyThemeManager *self)
+ EmpathyThemeManagerPriv *priv = GET_PRIV (self);
GtkStyle *style;
gchar color1[10];
gchar color2[10];
gchar color3[10];
gchar color4[10];
GtkStyle *style;
gchar color1[10];
gchar color2[10];
gchar color3[10];
gchar color4[10];
+ /* The simple theme depends on the current GTK+ theme so it has to be
+ * updated if the theme changes. */
+ if (tp_strdiff (priv->name, "simple"))
+ return;
+
style = gtk_widget_get_style (GTK_WIDGET (widget));
theme_manager_gdk_color_to_hex (&style->base[GTK_STATE_SELECTED], color1);
style = gtk_widget_get_style (GTK_WIDGET (widget));
theme_manager_gdk_color_to_hex (&style->base[GTK_STATE_SELECTED], color1);
EmpathyThemeManagerPriv *priv = GET_PRIV (manager);
if (strcmp (priv->name, "simple") == 0) {
EmpathyThemeManagerPriv *priv = GET_PRIV (manager);
if (strcmp (priv->name, "simple") == 0) {
- g_signal_connect (G_OBJECT (theme), "style-set",
- G_CALLBACK (on_style_set_cb), theme);
+ on_style_set_cb (GTK_WIDGET (theme), NULL, manager);
}
else if (strcmp (priv->name, "clean") == 0) {
theme_manager_update_boxes_tags (theme,
}
else if (strcmp (priv->name, "clean") == 0) {
theme_manager_update_boxes_tags (theme,