diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-03 14:36:55 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-03 14:36:55 (EDT) |
commit | d3461b32194c18d99329738fa7a64862de519c5b (patch) | |
tree | 9828696bbca6cebcd0008550ef90eaa5128d922d | |
parent | dcdf9eb677e315e88623182879a589787408a5ff (diff) | |
download | marquee-d3461b32194c18d99329738fa7a64862de519c5b.zip marquee-d3461b32194c18d99329738fa7a64862de519c5b.tar.gz marquee-d3461b32194c18d99329738fa7a64862de519c5b.tar.bz2 |
src/utils/profile-icon.c: Replace magic numbers with macros
-rw-r--r-- | src/utils/profile-icon.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/utils/profile-icon.c b/src/utils/profile-icon.c index e4f8d4d..4284a1d 100644 --- a/src/utils/profile-icon.c +++ b/src/utils/profile-icon.c @@ -28,9 +28,15 @@ #include "svg.h" +#define PROFILE_SVG_WIDTH 16 +#define PROFILE_SVG_HEIGHT 16 +#define STRX(S) #S +#define STR(S) STRX(S) static const gchar *profile_svg = - "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" " - "viewBox=\"0, 0, 16, 16\">\n" + "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + STR(PROFILE_SVG_WIDTH) "\" height=\"" STR(PROFILE_SVG_HEIGHT) + "\" viewBox=\"0, 0, " STR(PROFILE_SVG_WIDTH) ", " + STR(PROFILE_SVG_HEIGHT) "\">\n" "<rect x=\"1\" y=\"9\" width=\"14\" height=\"7\" " "rx=\"2\" ry=\"2\" fill=\"@COLOR@\" />\n" "<ellipse cx=\"8\" cy=\"11\" rx=\"7\" ry=\"4\" " @@ -57,7 +63,8 @@ mq_profile_icon_new_pixbuf(const gchar *color) RsvgHandle *handle; GdkPixbuf *pixbuf; - surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 16, 16); + surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, + PROFILE_SVG_WIDTH, PROFILE_SVG_HEIGHT); cr = cairo_create(surface); data = mq_profile_icon_new(color); |