summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-01-04 20:37:38 +0300
committermonsta <[email protected]>2016-01-04 20:37:38 +0300
commitc792f2a96b1383e37616733a0ed1454da008fa33 (patch)
treed64a1bbdac88c4c1259e21d37947cb677e1d74a0
parent73f1dbc41f35cc3729d8ac8727e654e8e3e20ac5 (diff)
downloadmate-panel-c792f2a96b1383e37616733a0ed1454da008fa33.tar.bz2
mate-panel-c792f2a96b1383e37616733a0ed1454da008fa33.tar.xz
background: less #if's
-rw-r--r--mate-panel/panel-widget.c36
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)