summaryrefslogtreecommitdiff
path: root/mate-panel
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-05-25 13:17:16 +0300
committermonsta <[email protected]>2015-05-25 13:17:16 +0300
commitbfcd64e90cf71537b1917472f3a58f30c826edbf (patch)
tree853e39fecaf0a8d48da1132bd87982459c447ab0 /mate-panel
parenta5c3193c5a02676a8312c04e30735d974ddf1b20 (diff)
parent4da202648feb8c82217852646f0f4c17bba9fb29 (diff)
downloadmate-panel-bfcd64e90cf71537b1917472f3a58f30c826edbf.tar.bz2
mate-panel-bfcd64e90cf71537b1917472f3a58f30c826edbf.tar.xz
Merge pull request #289 from rilian-la-te/simplify_image
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 9beb000f..35018409 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