diff options
author | Thomas Wood <thomas.wood@intel.com> | 2010-07-22 17:29:47 +0100 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2010-07-22 17:29:47 +0100 |
commit | b7ab940c783aa965514905d97de3d07a5767f3db (patch) | |
tree | 1b02692afc8f948b7a2008d52bc122ab5388b366 | |
parent | f5c0b73214c471320cc2dd0d318723523f5a2a09 (diff) | |
download | gnome-control-center-b7ab940c783aa965514905d97de3d07a5767f3db.tar.gz |
shell: make sure the background colours are updated if the style changes
Make sure the background of the main vbox uses base/text colour
combinations and is updated if the style changes
-rw-r--r-- | shell/gnome-control-center.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c index 2c4e1efa9..756385b41 100644 --- a/shell/gnome-control-center.c +++ b/shell/gnome-control-center.c @@ -899,12 +899,27 @@ gnome_control_center_class_init (GnomeControlCenterClass *klass) } static void +vbox_style_set_cb (GtkWidget *widget, + GtkStyle *old_style) +{ + GtkWidget *parent; + GtkStyle *style; + + parent = gtk_widget_get_parent (widget); + style = gtk_widget_get_style (widget); + gtk_widget_modify_bg (parent, GTK_STATE_NORMAL, + &style->base[GTK_STATE_NORMAL]); + gtk_widget_modify_fg (parent, GTK_STATE_NORMAL, + &style->text[GTK_STATE_NORMAL]); + +} + +static void gnome_control_center_init (GnomeControlCenter *self) { GError *err = NULL; - GtkWidget *vbox, *parent; + GtkWidget *vbox; GnomeControlCenterPrivate *priv; - GtkStyle *style; priv = self->priv = CONTROL_CENTER_PRIVATE (self); @@ -937,12 +952,11 @@ gnome_control_center_init (GnomeControlCenter *self) vbox = W (priv->builder, "main-vbox"); gtk_widget_set_size_request (vbox, 0, -1); - parent = gtk_widget_get_parent (vbox); - style = gtk_widget_get_style (vbox); - gtk_widget_modify_bg (parent, GTK_STATE_NORMAL, - &style->base[GTK_STATE_NORMAL]); - gtk_widget_modify_fg (parent, GTK_STATE_NORMAL, - &style->text[GTK_STATE_NORMAL]); + /* make sure the background of the vbox uses base/text colour combinations + * and is updated if the style changes */ + vbox_style_set_cb (vbox, NULL); + g_signal_connect (vbox, "style-set", G_CALLBACK (vbox_style_set_cb), + NULL); /* load the available settings panels */ fill_model (self); |