diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-11-08 16:11:29 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-11-08 16:11:29 +0000 |
commit | 6442aefcbd1ded224e75dfc58f62af01787915b2 (patch) | |
tree | cb095bb69a16b6fb7346571fe5c6b73453ba2a51 /navit/layout.c | |
parent | 246d378ca1b92fdd95fe7243a7aff3004178260a (diff) | |
download | navit-svn-6442aefcbd1ded224e75dfc58f62af01787915b2.tar.gz |
Add:Core:Possibility for colored text in labels
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3658 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/layout.c')
-rw-r--r-- | navit/layout.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/navit/layout.c b/navit/layout.c index 91dc8ed8..04935ef8 100644 --- a/navit/layout.c +++ b/navit/layout.c @@ -351,6 +351,17 @@ element_set_color(struct element *e, struct attr **attrs) e->color=*color->u.color; } + +static void +element_set_background_color(struct color *c, struct attr **attrs) +{ + struct attr *color; + color=attr_search(attrs, NULL, attr_background_color); + if (color) + *c=*color->u.color; +} + + static void element_set_text_size(struct element *e, struct attr **attrs) { @@ -455,7 +466,10 @@ circle_new(struct attr *parent, struct attr **attrs) e = g_new0(struct element, 1); e->type=element_circle; + e->color = COLOR_BLACK; + e->u.circle.background_color = COLOR_WHITE; element_set_color(e, attrs); + element_set_background_color(&e->u.circle.background_color, attrs); element_set_text_size(e, attrs); element_set_circle_width(e, attrs); element_set_circle_radius(e, attrs); @@ -471,6 +485,10 @@ text_new(struct attr *parent, struct attr **attrs) e = g_new0(struct element, 1); e->type=element_text; element_set_text_size(e, attrs); + e->color = COLOR_BLACK; + e->u.text.background_color = COLOR_WHITE; + element_set_color(e, attrs); + element_set_background_color(&e->u.text.background_color, attrs); return (struct text *)e; } |