Commit 19095aa9 authored by Julian Sparber's avatar Julian Sparber
Browse files

parse title property for icon-dev-kit

parent da88b119
......@@ -83,6 +83,7 @@ fn main() {
class: vec![],
};
let mut title_open = false;
for e in parser {
match e {
Ok(XmlEvent::StartElement {
......@@ -106,7 +107,7 @@ fn main() {
if let Some((ref index, ref mut item)) = current {
if level == index + 1 {
/* Find group elements */
if a.name.local_name == "label" {
if a.name.local_name == "title" {
item.name = a.value.clone();
}
if a.name.local_name == "id" {
......@@ -116,6 +117,8 @@ fn main() {
}
}
}
title_open = name.local_name == "title";
if let Some((ref index, ref mut item)) = current {
if level == index + 2 {
let color = attributes
......@@ -180,8 +183,17 @@ fn main() {
}
}
}
if name.local_name == "title" {
title_open = false;
}
level = level - 1;
}
Ok(XmlEvent::Characters(s)) => {
if title_open {
item.name = s;
}
}
Err(e) => {
println!("Error: {}", e);
break;
......@@ -248,7 +260,7 @@ fn validate_item(item: &Icon, v: bool) -> bool {
}
if item.square == "" {
println!("FIXME: {} has no 16x16 square, icon ignored", item.name);
return false;
//return false;
}
if item.name.ends_with("-old") {
if v {
......@@ -281,7 +293,7 @@ fn render(handle: &SvgHandle, item: &Icon, file: &String) -> bool {
};
let (rect, _) = renderer
.geometry_for_element(Some(&rect), &viewport)
.geometry_for_element(Some(&group), &viewport)
.unwrap();
/* don't render icons outside the viewport */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment