summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-17 18:09:57 +0200
committerraveit65 <[email protected]>2016-07-02 12:31:11 +0200
commit7c6ca27018bfd41a82c0732e9a371c3e6112b55d (patch)
treef774748ace8e7564d6bfdab7e4892d9fd74cf4c4
parent42d3d76f542ef4d401284d4b616ed8b4f55b9bed (diff)
downloadmate-control-center-7c6ca27018bfd41a82c0732e9a371c3e6112b55d.tar.bz2
mate-control-center-7c6ca27018bfd41a82c0732e9a371c3e6112b55d.tar.xz
GTK+-3 appearance-style: port GdkColor to GdkRGBA
-rw-r--r--capplets/appearance/appearance-style.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/capplets/appearance/appearance-style.c b/capplets/appearance/appearance-style.c
index f5722a1f..51161f67 100644
--- a/capplets/appearance/appearance-style.c
+++ b/capplets/appearance/appearance-style.c
@@ -295,7 +295,11 @@ static void update_message_area(AppearanceData* data)
static void
update_color_buttons_from_string (const gchar *color_scheme, AppearanceData *data)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA colors[NUM_SYMBOLIC_COLORS];
+#else
GdkColor colors[NUM_SYMBOLIC_COLORS];
+#endif
GtkWidget *widget;
gint i;
@@ -305,7 +309,11 @@ update_color_buttons_from_string (const gchar *color_scheme, AppearanceData *dat
/* now set all the buttons to the correct settings */
for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
widget = appearance_capplet_get_widget (data, symbolic_names[i]);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (widget), &colors[i]);
+#else
gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &colors[i]);
+#endif
}
}
@@ -376,7 +384,11 @@ static void
color_button_clicked_cb (GtkWidget *colorbutton, AppearanceData *data)
{
GtkWidget *widget;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color;
+#else
GdkColor color;
+#endif
GString *scheme = g_string_new (NULL);
gchar *colstr;
gchar *old_scheme = NULL;
@@ -384,9 +396,17 @@ color_button_clicked_cb (GtkWidget *colorbutton, AppearanceData *data)
for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
widget = appearance_capplet_get_widget (data, symbolic_names[i]);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (widget), &color);
+#else
gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &color);
+#endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+ colstr = gdk_rgba_to_string (&color);
+#else
colstr = gdk_color_to_string (&color);
+#endif
g_string_append_printf (scheme, "%s:%s\n", symbolic_names[i], colstr);
g_free (colstr);
}