summaryrefslogtreecommitdiff
path: root/drivemount/drive-button.c
diff options
context:
space:
mode:
authormarosg <[email protected]>2017-09-07 07:31:37 +0200
committermarosg <[email protected]>2017-09-08 16:14:45 +0200
commit5fedc5bcdc4f276709552ca40958442151bb97b4 (patch)
tree05e0ec708ed8625bb41725808c8300af9b381e9f /drivemount/drive-button.c
parent14a072cd5c936ae75e5df1c2dc25610716fb41e7 (diff)
downloadmate-applets-5fedc5bcdc4f276709552ca40958442151bb97b4.tar.bz2
mate-applets-5fedc5bcdc4f276709552ca40958442151bb97b4.tar.xz
GSettings for checkmark color shown for mounted volumes.
Diffstat (limited to 'drivemount/drive-button.c')
-rw-r--r--drivemount/drive-button.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c
index fdaad0a2..ff766fcb 100644
--- a/drivemount/drive-button.c
+++ b/drivemount/drive-button.c
@@ -485,6 +485,17 @@ drive_button_update (gpointer user_data)
rowstride = gdk_pixbuf_get_rowstride (tmp_pixbuf);
pixels = gdk_pixbuf_get_pixels (tmp_pixbuf);
+ GdkRGBA color;
+ gchar *color_string = g_settings_get_string (settings, "drivemount-checkmark-color");
+ if (!color_string)
+ color_string = g_strdup ("#00ff00");
+ gdk_rgba_parse (&color, color_string);
+ g_free (color_string);
+
+ guchar red = color.red*255;
+ guchar green = color.green*255;
+ guchar blue = color.blue*255;
+
const gdouble ratio = 0.65;
gdouble y_start = icon_height * ratio;
gdouble x_start = icon_height * (1 + ratio);
@@ -493,9 +504,9 @@ drive_button_update (gpointer user_data)
for (x = x_start - y; x < icon_width; x++)
{
p = pixels + y * rowstride + x * n_channels;
- p[0] = 0;
- p[1] = 230;
- p[2] = 0;
+ p[0] = red;
+ p[1] = green;
+ p[2] = blue;
p[3] = 255;
}
}