diff options
author | marosg <[email protected]> | 2017-09-07 07:31:37 +0200 |
---|---|---|
committer | marosg <[email protected]> | 2017-09-08 16:14:45 +0200 |
commit | 5fedc5bcdc4f276709552ca40958442151bb97b4 (patch) | |
tree | 05e0ec708ed8625bb41725808c8300af9b381e9f /drivemount/drive-button.c | |
parent | 14a072cd5c936ae75e5df1c2dc25610716fb41e7 (diff) | |
download | mate-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.c | 17 |
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; } } |