summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes_applet.c
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-02-12 14:55:25 +0300
committerStefano Karapetsas <[email protected]>2015-03-15 18:58:50 +0100
commit36b3ed6c866ccec238f479163fea424fb672c912 (patch)
tree4d18c10e4862d529ec66abdca9a30b2cb08751f3 /stickynotes/stickynotes_applet.c
parent28e2e2ea744cf845d21b15adf4e37c61b4ff59a4 (diff)
downloadmate-applets-36b3ed6c866ccec238f479163fea424fb672c912.tar.bz2
mate-applets-36b3ed6c866ccec238f479163fea424fb672c912.tar.xz
stickynotes: use modern color-related API in GTK+3 build
Diffstat (limited to 'stickynotes/stickynotes_applet.c')
-rw-r--r--stickynotes/stickynotes_applet.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index 133ca2bf..ed5563ae 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -452,10 +452,13 @@ stickynotes_applet_update_prefs (void)
gboolean sys_color, sys_font, sticky, force_default, desktop_hide;
char *font_str;
char *color_str, *font_color_str;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color, font_color;
+#else
GdkColor color, font_color;
+#endif
width = g_settings_get_int (stickynotes->settings, "default-width");
-
width = MAX (width, 1);
height = g_settings_get_int (stickynotes->settings, "default-height");
height = MAX (height, 1);
@@ -483,10 +486,15 @@ stickynotes_applet_update_prefs (void)
font_color_str = g_strdup ("#000000");
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_parse (&color, color_str);
+ gdk_rgba_parse (&font_color, font_color_str);
+#else
gdk_color_parse (color_str, &color);
- g_free (color_str);
-
gdk_color_parse (font_color_str, &font_color);
+#endif
+
+ g_free (color_str);
g_free (font_color_str);
gtk_adjustment_set_value (stickynotes->w_prefs_width, width);
@@ -507,13 +515,15 @@ stickynotes_applet_update_prefs (void)
GTK_TOGGLE_BUTTON (stickynotes->w_prefs_desktop),
desktop_hide);
- gtk_color_button_set_color (
- GTK_COLOR_BUTTON (stickynotes->w_prefs_color), &color);
- gtk_color_button_set_color (
- GTK_COLOR_BUTTON (stickynotes->w_prefs_font_color),
- &font_color);
- gtk_font_button_set_font_name (
- GTK_FONT_BUTTON (stickynotes->w_prefs_font), font_str);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_button_set_rgba (GTK_COLOR_BUTTON (stickynotes->w_prefs_color), &color);
+ gtk_color_button_set_rgba (GTK_COLOR_BUTTON (stickynotes->w_prefs_font_color), &font_color);
+#else
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (stickynotes->w_prefs_color), &color);
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (stickynotes->w_prefs_font_color), &font_color);
+#endif
+
+ gtk_font_button_set_font_name (GTK_FONT_BUTTON (stickynotes->w_prefs_font), font_str);
g_free (font_str);
if (g_settings_is_writable (stickynotes->settings, "default-color"))