summaryrefslogtreecommitdiff
path: root/capplets/appearance
diff options
context:
space:
mode:
Diffstat (limited to 'capplets/appearance')
-rw-r--r--capplets/appearance/appearance-desktop.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/capplets/appearance/appearance-desktop.c b/capplets/appearance/appearance-desktop.c
index 385249b3..a79e3c5c 100644
--- a/capplets/appearance/appearance-desktop.c
+++ b/capplets/appearance/appearance-desktop.c
@@ -368,15 +368,25 @@ wp_color_changed (AppearanceData *data,
if (item == NULL)
return;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker), item->pcolor);
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker), item->scolor);
+#else
gtk_color_button_get_color (GTK_COLOR_BUTTON (data->wp_pcpicker), item->pcolor);
gtk_color_button_get_color (GTK_COLOR_BUTTON (data->wp_scpicker), item->scolor);
+#endif
if (update)
{
gchar *pcolor, *scolor;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ pcolor = gdk_rgba_to_string (item->pcolor);
+ scolor = gdk_rgba_to_string (item->scolor);
+#else
pcolor = gdk_color_to_string (item->pcolor);
scolor = gdk_color_to_string (item->scolor);
+#endif
g_settings_delay (data->wp_settings);
g_settings_set_string (data->wp_settings, WP_PCOLOR_KEY, pcolor);
g_settings_set_string (data->wp_settings, WP_SCOLOR_KEY, scolor);
@@ -499,14 +509,24 @@ wp_color1_changed (GSettings *settings,
gchar *key,
AppearanceData *data)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color;
+#else
GdkColor color;
+#endif
gchar *colorhex;
colorhex = g_settings_get_string (settings, key);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_parse (&color, colorhex);
+
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker), &color);
+#else
gdk_color_parse (colorhex, &color);
gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_pcpicker), &color);
+#endif
wp_color_changed (data, FALSE);
@@ -518,16 +538,26 @@ wp_color2_changed (GSettings *settings,
gchar *key,
AppearanceData *data)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color;
+#else
GdkColor color;
+#endif
gchar *colorhex;
wp_set_sensitivities (data);
colorhex = g_settings_get_string (settings, key);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_parse (&color, colorhex);
+
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker), &color);
+#else
gdk_color_parse (colorhex, &color);
gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_scpicker), &color);
+#endif
wp_color_changed (data, FALSE);
@@ -567,8 +597,13 @@ wp_props_wp_set (AppearanceData *data, MateWPItem *item)
g_settings_set_enum (data->wp_settings, WP_SHADING_KEY, item->shade_type);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ pcolor = gdk_rgba_to_string (item->pcolor);
+ scolor = gdk_rgba_to_string (item->scolor);
+#else
pcolor = gdk_color_to_string (item->pcolor);
scolor = gdk_color_to_string (item->scolor);
+#endif
g_settings_set_string (data->wp_settings, WP_PCOLOR_KEY, pcolor);
g_settings_set_string (data->wp_settings, WP_SCOLOR_KEY, scolor);
g_free (pcolor);
@@ -596,10 +631,17 @@ wp_props_wp_selected (GtkTreeSelection *selection,
wp_option_menu_set (data, item->shade_type, TRUE);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker),
+ item->pcolor);
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker),
+ item->scolor);
+#else
gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_pcpicker),
item->pcolor);
gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_scpicker),
item->scolor);
+#endif
wp_props_wp_set (data, item);
}