summaryrefslogtreecommitdiff
path: root/src/callbacks.cpp
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2015-11-29 18:10:09 +0100
committerWolfgang Ulbrich <[email protected]>2015-12-01 19:45:21 +0100
commitb7d7127bfa1b1c2e8d10467087556298cdc77102 (patch)
tree2f603c303e35f188593d5ca8fabe8459e609b720 /src/callbacks.cpp
parentdf50b9c871f4f00609bef2ee022495677c4511fa (diff)
downloadmate-system-monitor-b7d7127bfa1b1c2e8d10467087556298cdc77102.tar.bz2
mate-system-monitor-b7d7127bfa1b1c2e8d10467087556298cdc77102.tar.xz
GTK3: Do not use deprecated API
Namely, we make the following replacements: * GtkStyle -> GtkStyleContext * GdkColor -> GdkRGBA * GtkColorSelectionDialog -> GtkColorChooserDialog taken from....but adjusted: https://git.gnome.org/browse/gnome-system-monitor/commit/?id=7ac1c1c
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
}