summaryrefslogtreecommitdiff
path: root/mate-panel
diff options
context:
space:
mode:
authorKonstantin Pugin <[email protected]>2015-03-06 02:30:48 +0600
committerKonstantin Pugin <[email protected]>2015-03-06 03:09:28 +0600
commit4da202648feb8c82217852646f0f4c17bba9fb29 (patch)
tree6098f156717e9a6d28d7d098d45cfc23ee9c35d5 /mate-panel
parent357bddafdedd424cef23b91b2d2ee09c7c7355ff (diff)
downloadmate-panel-4da202648feb8c82217852646f0f4c17bba9fb29.tar.bz2
mate-panel-4da202648feb8c82217852646f0f4c17bba9fb29.tar.xz
Remove change_background_for_widget from GTK3 build (it is useless.)
Diffstat (limited to 'mate-panel')
-rw-r--r--mate-panel/panel-background.c74
-rw-r--r--mate-panel/panel-background.h3
2 files changed, 3 insertions, 74 deletions
diff --git a/mate-panel/panel-background.c b/mate-panel/panel-background.c
index d7b61f64..31930bd3 100644
--- a/mate-panel/panel-background.c
+++ b/mate-panel/panel-background.c
@@ -1494,83 +1494,11 @@ panel_background_set_color_background_on_widget (PanelBackground *background,
gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &color->gdk);
}
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
-static GtkStyleProperties *
-_panel_background_get_widget_style_properties (GtkWidget *widget, gboolean create_if_needed)
-{
- GtkStyleProperties *properties;
-
- properties = g_object_get_data (G_OBJECT (widget), "panel-object-style-props");
- if (!properties && create_if_needed) {
- properties = gtk_style_properties_new ();
- g_object_set_data_full (G_OBJECT (widget), "panel-object-style-props",
- properties, (GDestroyNotify) g_object_unref);
- }
- return properties;
-}
-
-static void
-_panel_background_reset_widget_style_properties (GtkWidget *widget)
-{
- GtkStyleProperties *properties;
-
- properties = _panel_background_get_widget_style_properties (widget, FALSE);
-
- if (properties)
- gtk_style_context_remove_provider (gtk_widget_get_style_context (widget),
- GTK_STYLE_PROVIDER (properties));
-
- g_object_set_data (G_OBJECT (widget), "panel-object-style-props", NULL);
-}
-#endif
void
panel_background_change_background_on_widget (PanelBackground *background,
GtkWidget *widget)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
- GtkStyleProperties *properties;
-
- gtk_widget_reset_style (widget);
-
- switch (panel_background_get_type (background)) {
- case PANEL_BACK_NONE:
- _panel_background_reset_widget_style_properties (widget);
- return;
- case PANEL_BACK_COLOR:
- properties = _panel_background_get_widget_style_properties (widget, TRUE);
- gtk_style_properties_set (properties, GTK_STATE_FLAG_NORMAL,
- "background-color", &background->color,
- "background-image", NULL,
- NULL);
- break;
- case PANEL_BACK_IMAGE: {
- cairo_pattern_t *pattern;
-
- properties = _panel_background_get_widget_style_properties (widget, TRUE);
- pattern = panel_background_get_pattern_for_widget (background, widget);
- if (pattern) {
- gtk_style_properties_set (properties, GTK_STATE_FLAG_NORMAL,
- "background-image", pattern,
- NULL);
- cairo_pattern_destroy (pattern);
- } else {
- _panel_background_reset_widget_style_properties (widget);
- return;
- }
- }
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-
- gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
- GTK_STYLE_PROVIDER (properties),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-#else
PanelBackgroundType type;
panel_background_set_no_background_on_widget (background, widget);
@@ -1592,6 +1520,6 @@ panel_background_change_background_on_widget (PanelBackground *background,
g_assert_not_reached ();
break;
}
-#endif
}
+#endif
diff --git a/mate-panel/panel-background.h b/mate-panel/panel-background.h
index 6c36873b..d69f529c 100644
--- a/mate-panel/panel-background.h
+++ b/mate-panel/panel-background.h
@@ -158,10 +158,11 @@ const GdkPixmap *panel_background_get_pixmap (PanelBackground *background);
PanelBackgroundType
panel_background_effective_type (PanelBackground *background);
+#if !GTK_CHECK_VERSION (3, 0, 0)
void panel_background_change_background_on_widget (PanelBackground *background,
GtkWidget *widget);
-#if GTK_CHECK_VERSION (3, 0, 0)
+#else
void panel_background_apply_css(GtkWidget* widget);
#endif