summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorHib Eris <hib@hiberis.nl>2012-12-02 10:04:28 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2012-12-02 18:05:19 +0100
commitc46646020826136b403e9aae8e2ded24c7165522 (patch)
treebb8166476dfa3e81baf106f3c7de9541aea199e2 /glib
parentf8c1b55e764a6e79b0530fb1be9ee11917f4237e (diff)
glib-demo: Do not use deprecated gtk_color_button_{get,set}_rgba()
Since Gtk 3.4, gtk_color_button_get_rgba() and gtk_color_button_set_rgba() have been deprecated. https://bugs.freedesktop.org/show_bug.cgi?id=57798
Diffstat (limited to 'glib')
-rw-r--r--glib/demo/selections.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/glib/demo/selections.c b/glib/demo/selections.c
index 0e0d7090..7ff17cdf 100644
--- a/glib/demo/selections.c
+++ b/glib/demo/selections.c
@@ -336,9 +336,17 @@ pgd_selections_drawing_area_realize (GtkWidget *area,
g_object_set (area, "has-tooltip", TRUE, NULL);
gtk_style_context_get_color (style_context, GTK_STATE_FLAG_SELECTED, &rgba);
+#if GTK_CHECK_VERSION(3,4,0)
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->fg_color_button), &rgba);
+#else
gtk_color_button_set_rgba (GTK_COLOR_BUTTON (demo->fg_color_button), &rgba);
+#endif
gtk_style_context_get_background_color (style_context, GTK_STATE_FLAG_SELECTED, &rgba);
+#if GTK_CHECK_VERSION(3,4,0)
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->bg_color_button), &rgba);
+#else
gtk_color_button_set_rgba (GTK_COLOR_BUTTON (demo->bg_color_button), &rgba);
+#endif
}
static gboolean
@@ -457,7 +465,11 @@ pgd_selections_fg_color_changed (GtkColorButton *button,
{
GdkRGBA color;
+#if GTK_CHECK_VERSION(3,4,0)
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
+#else
gtk_color_button_get_rgba (GTK_COLOR_BUTTON (button), &color);
+#endif
demo->glyph_color.red = CLAMP ((guint) (color.red * 65535), 0, 65535);
demo->glyph_color.green = CLAMP ((guint) (color.green * 65535), 0, 65535);
demo->glyph_color.blue = CLAMP ((guint) (color.blue * 65535), 0, 65535);
@@ -470,7 +482,11 @@ pgd_selections_bg_color_changed (GtkColorButton *button,
{
GdkRGBA color;
+#if GTK_CHECK_VERSION(3,4,0)
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
+#else
gtk_color_button_get_rgba (GTK_COLOR_BUTTON (button), &color);
+#endif
demo->background_color.red = CLAMP ((guint) (color.red * 65535), 0, 65535);
demo->background_color.green = CLAMP ((guint) (color.green * 65535), 0, 65535);
demo->background_color.blue = CLAMP ((guint) (color.blue * 65535), 0, 65535);