summaryrefslogtreecommitdiff
path: root/src/callbacks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/callbacks.cpp')
-rw-r--r--src/callbacks.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/callbacks.cpp b/src/callbacks.cpp
index 4540dba..bb18e8b 100644
--- a/src/callbacks.cpp
+++ b/src/callbacks.cpp
@@ -250,12 +250,22 @@ cb_end_process_button_pressed (GtkButton *button, gpointer data)
static void change_settings_color(GSettings *settings, const char *key,
GSMColorButton *cp)
{
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA c;
+ char *color;
+
+ gsm_color_button_get_color(cp, &c);
+ color = gdk_rgba_to_string (&c);
+ g_settings_set_string (settings, key, color);
+ g_free (color);
+#else
GdkColor c;
char color[24]; /* color should be 1 + 3*4 + 1 = 15 chars -> 24 */
gsm_color_button_get_color(cp, &c);
g_snprintf(color, sizeof color, "#%04x%04x%04x", c.red, c.green, c.blue);
g_settings_set_string (settings, key, color);
+#endif
}