summaryrefslogtreecommitdiff
path: root/src/caja-property-browser.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-01-04 19:18:37 +0100
committerraveit65 <[email protected]>2022-01-28 23:59:38 +0100
commit95dcc0147afba6c11c5eaa273e2602aecafeac8b (patch)
tree7147fe8b6d6897b130c52b5bce54a31fade0de81 /src/caja-property-browser.c
parenta9e28f0248eab3dbf7fc89914fe599ff185872a8 (diff)
downloadcaja-95dcc0147afba6c11c5eaa273e2602aecafeac8b.tar.bz2
caja-95dcc0147afba6c11c5eaa273e2602aecafeac8b.tar.xz
caja-property-browser: 'gdk_color_parse' is deprecated
Diffstat (limited to 'src/caja-property-browser.c')
-rw-r--r--src/caja-property-browser.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c
index 1a5ceffa..8930cdcf 100644
--- a/src/caja-property-browser.c
+++ b/src/caja-property-browser.c
@@ -616,18 +616,18 @@ caja_property_browser_drag_data_get (GtkWidget *widget,
else if (strcmp (property_browser->details->drag_type,
"application/x-color") == 0)
{
- GdkColor color;
- guint16 colorArray[4];
-
/* handle the "reset" case as an image */
if (g_strcmp0 (property_browser->details->dragged_file, RESET_IMAGE_NAME) != 0)
{
- gdk_color_parse (property_browser->details->dragged_file, &color);
+ GdkRGBA color;
+ guint16 colorArray [4];
+
+ gdk_rgba_parse (&color, property_browser->details->dragged_file);
- colorArray[0] = color.red;
- colorArray[1] = color.green;
- colorArray[2] = color.blue;
- colorArray[3] = 0xffff;
+ colorArray [0] = (guint16) (color.red * 65535.0);
+ colorArray [1] = (guint16) (color.green * 65535.0);
+ colorArray [2] = (guint16) (color.blue * 65535.0);
+ colorArray [3] = USHRT_MAX;
gtk_selection_data_set(selection_data,
target, 16, (const char *) &colorArray[0], 8);
@@ -805,15 +805,15 @@ make_color_drag_image (CajaPropertyBrowser *property_browser, const char *color_
GdkPixbuf *ret;
int row, col, stride;
guchar *pixels;
- GdkColor color;
+ GdkRGBA color;
guchar red, green, blue;
color_square = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, COLOR_SQUARE_SIZE, COLOR_SQUARE_SIZE);
- gdk_color_parse (color_spec, &color);
- red = (guchar)(color.red >> 8);
- green = (guchar)(color.green >> 8);
- blue = (guchar)(color.blue >> 8);
+ gdk_rgba_parse (&color, color_spec);
+ red = (guchar) (color.red * 255.0);
+ green = (guchar) (color.green * 255.0);
+ blue = (guchar) (color.blue * 255.0);
pixels = gdk_pixbuf_get_pixels (color_square);
stride = gdk_pixbuf_get_rowstride (color_square);