From 714c687d412e9ee4d265c77168e2037ef4dde139 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Sun, 8 Jul 2007 15:07:19 -0500 Subject: [PATCH] Set paned background on theme switch --- moo/mooutils/moopaned.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/moo/mooutils/moopaned.c b/moo/mooutils/moopaned.c index 7ecdeaf5..076ffca2 100644 --- a/moo/mooutils/moopaned.c +++ b/moo/mooutils/moopaned.c @@ -110,6 +110,8 @@ static void moo_paned_map (GtkWidget *widget); static void moo_paned_unmap (GtkWidget *widget); static gboolean moo_paned_focus (GtkWidget *widget, GtkDirectionType direction); +static void moo_paned_style_set (GtkWidget *widget, + GtkStyle *old_style); static void moo_paned_set_focus_child (GtkContainer *container, GtkWidget *widget); @@ -230,6 +232,7 @@ moo_paned_class_init (MooPanedClass *klass) widget_class->realize = moo_paned_realize; widget_class->unrealize = moo_paned_unrealize; + widget_class->style_set = moo_paned_style_set; widget_class->map = moo_paned_map; widget_class->unmap = moo_paned_unmap; widget_class->expose_event = moo_paned_expose; @@ -595,6 +598,16 @@ _moo_paned_get_position (MooPaned *paned) } +static void +moo_paned_style_set (GtkWidget *widget, + G_GNUC_UNUSED GtkStyle *old_style) +{ + MooPaned *paned = MOO_PANED (widget); + + if (widget->style && paned->priv->bin_window) + gtk_style_set_background (widget->style, paned->priv->bin_window, GTK_STATE_NORMAL); +} + static void moo_paned_realize (GtkWidget *widget) { @@ -604,8 +617,6 @@ moo_paned_realize (GtkWidget *widget) paned = MOO_PANED (widget); - GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); - widget->window = gtk_widget_get_parent_window (widget); g_object_ref (widget->window); @@ -630,6 +641,8 @@ moo_paned_realize (GtkWidget *widget) widget->style = gtk_style_attach (widget->style, widget->window); gtk_style_set_background (widget->style, paned->priv->bin_window, GTK_STATE_NORMAL); + GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); + realize_pane (paned); if (paned->button_box)