summaryrefslogtreecommitdiff
path: root/capplets/appearance
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-17 01:26:08 +0200
committerraveit65 <[email protected]>2016-07-02 12:31:11 +0200
commit40d833ec5846a7e2f4bbe7bf794e6f5bebe15d00 (patch)
tree7e1976ce3a22ada85b8c73313178ddd42a322865 /capplets/appearance
parent1a5bb9681bede5e1ddf6386c75ff55c464956e99 (diff)
downloadmate-control-center-40d833ec5846a7e2f4bbe7bf794e6f5bebe15d00.tar.bz2
mate-control-center-40d833ec5846a7e2f4bbe7bf794e6f5bebe15d00.tar.xz
GTK+3 mate-wp-item: port GdkColor to GdkRGBA
Diffstat (limited to 'capplets/appearance')
-rw-r--r--capplets/appearance/mate-wp-item.c30
-rw-r--r--capplets/appearance/mate-wp-item.h5
2 files changed, 35 insertions, 0 deletions
diff --git a/capplets/appearance/mate-wp-item.c b/capplets/appearance/mate-wp-item.c
index 96e7d67a..9daef0d0 100644
--- a/capplets/appearance/mate-wp-item.c
+++ b/capplets/appearance/mate-wp-item.c
@@ -118,7 +118,11 @@ void mate_wp_item_ensure_mate_bg (MateWPItem *item)
void mate_wp_item_update (MateWPItem *item) {
GSettings *settings;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color1 = { 0, 0, 0, 1.0 }, color2 = { 0, 0, 0, 1.0 };
+#else
GdkColor color1 = { 0, 0, 0, 0 }, color2 = { 0, 0, 0, 0 };
+#endif
gchar *s;
settings = g_settings_new (WP_SCHEMA);
@@ -129,26 +133,45 @@ void mate_wp_item_update (MateWPItem *item) {
s = g_settings_get_string (settings, WP_PCOLOR_KEY);
if (s != NULL) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_parse (&color1, s);
+#else
gdk_color_parse (s, &color1);
+#endif
g_free (s);
}
s = g_settings_get_string (settings, WP_SCOLOR_KEY);
if (s != NULL) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_parse (&color2, s);
+#else
gdk_color_parse (s, &color2);
+#endif
g_free (s);
}
g_object_unref (settings);
if (item->pcolor != NULL)
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_free (item->pcolor);
+#else
gdk_color_free (item->pcolor);
+#endif
if (item->scolor != NULL)
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_free (item->scolor);
+
+ item->pcolor = gdk_rgba_copy (&color1);
+ item->scolor = gdk_rgba_copy (&color2);
+#else
gdk_color_free (item->scolor);
item->pcolor = gdk_color_copy (&color1);
item->scolor = gdk_color_copy (&color2);
+#endif
}
MateWPItem * mate_wp_item_new (const gchar * filename,
@@ -192,10 +215,17 @@ void mate_wp_item_free (MateWPItem * item) {
g_free (item->description);
if (item->pcolor != NULL)
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_free (item->pcolor);
+
+ if (item->scolor != NULL)
+ gdk_rgba_free (item->scolor);
+#else
gdk_color_free (item->pcolor);
if (item->scolor != NULL)
gdk_color_free (item->scolor);
+#endif
mate_wp_info_free (item->fileinfo);
if (item->bg)
diff --git a/capplets/appearance/mate-wp-item.h b/capplets/appearance/mate-wp-item.h
index 5e336d53..f75b8474 100644
--- a/capplets/appearance/mate-wp-item.h
+++ b/capplets/appearance/mate-wp-item.h
@@ -45,8 +45,13 @@ struct _MateWPItem {
GtkTreeRowReference * rowref;
/* Real colors */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA * pcolor;
+ GdkRGBA * scolor;
+#else
GdkColor * pcolor;
GdkColor * scolor;
+#endif
MateWPInfo * fileinfo;