diff options
-rw-r--r-- | mate-panel/panel-widget.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c index 1930e797..1af520bf 100644 --- a/mate-panel/panel-widget.c +++ b/mate-panel/panel-widget.c @@ -1630,25 +1630,16 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap) return FALSE; } -static void #if GTK_CHECK_VERSION (3, 0, 0) +static void panel_widget_set_background_default_style (GtkWidget *widget) -#else -panel_widget_style_set (GtkWidget *widget, GtkStyle *previous_style) -#endif { -#if GTK_CHECK_VERSION (3, 0, 0) GtkStyleContext *context; GtkStateFlags state; GdkRGBA bg_color; cairo_pattern_t *bg_image; -#else - GtkStyle *style; - GtkStateType state; -#endif if (gtk_widget_get_realized (widget)) { -#if GTK_CHECK_VERSION (3, 0, 0) context = gtk_widget_get_style_context (widget); state = gtk_widget_get_state_flags (widget); gtk_style_context_add_class(context,"gnome-panel-menu-bar"); @@ -1657,25 +1648,34 @@ panel_widget_style_set (GtkWidget *widget, GtkStyle *previous_style) gtk_style_context_get_background_color (context, state, &bg_color); gtk_style_context_get (context, state, "background-image", &bg_image, NULL); -#else - style = gtk_widget_get_style (widget); - state = gtk_widget_get_state (widget); -#endif panel_background_set_default_style ( &PANEL_WIDGET (widget)->background, -#if GTK_CHECK_VERSION (3, 0, 0) &bg_color, bg_image); - if (bg_image) - cairo_pattern_destroy (bg_image); + if (bg_image) + cairo_pattern_destroy (bg_image); + } +} #else +static void +panel_widget_style_set (GtkWidget *widget, GtkStyle *previous_style) +{ + GtkStyle *style; + GtkStateType state; + + if (gtk_widget_get_realized (widget)) { + style = gtk_widget_get_style (widget); + state = gtk_widget_get_state (widget); + + panel_background_set_default_style ( + &PANEL_WIDGET (widget)->background, &style->bg [state], style->bg_pixmap [state]); -#endif } } +#endif static void #if GTK_CHECK_VERSION (3, 0, 0) |