[gnome-control-center] universal-access: Fix deprecation warnings
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] universal-access: Fix deprecation warnings
- Date: Thu, 16 Aug 2012 09:46:48 +0000 (UTC)
commit b106468e01e7ef6be5b7784808f152318a8ba925
Author: Bastien Nocera <hadess hadess net>
Date: Wed Aug 15 19:05:17 2012 +0100
universal-access: Fix deprecation warnings
Related to GtkColorButton
https://bugzilla.gnome.org/show_bug.cgi?id=676817
panels/universal-access/zoom-options.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/panels/universal-access/zoom-options.c b/panels/universal-access/zoom-options.c
index 986e6db..318b1fe 100644
--- a/panels/universal-access/zoom-options.c
+++ b/panels/universal-access/zoom-options.c
@@ -296,7 +296,7 @@ init_xhairs_color_opacity (GtkColorButton *color_button, GSettings *settings)
gdk_rgba_parse (&rgba, color_setting);
rgba.alpha = g_settings_get_double (settings, "cross-hairs-opacity");
- gtk_color_button_set_rgba (color_button, &rgba);
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &rgba);
}
static void
@@ -308,10 +308,13 @@ xhairs_color_notify_cb (GSettings *settings, gchar *key, GtkColorButton *button)
static void
xhairs_opacity_notify_cb (GSettings *settings, gchar *key, GtkColorButton *button)
{
+ GdkRGBA rgba;
gdouble opacity;
opacity = g_settings_get_double (settings, key);
- gtk_color_button_set_alpha (button, opacity * 65535);
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &rgba);
+ rgba.alpha = opacity * 65535;
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (button), &rgba);
}
#define TO_HEX(x) (int) ((gdouble) x * 255.0)
@@ -321,7 +324,7 @@ xhairs_color_opacity_changed (GtkColorButton *button, ZoomOptionsPrivate *priv)
GdkRGBA rgba;
gchar *color_string;
- gtk_color_button_get_rgba (button, &rgba);
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &rgba);
color_string = g_strdup_printf ("#%02x%02x%02x",
TO_HEX(rgba.red),
TO_HEX(rgba.green),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]