Sculpt: avoid superfluous vertical space w/o info

When a <pkg> node of an index lacks an 'info' attribute, omit the
corresponding fields in the pkg dialog to avoid blank vertical space.
This commit is contained in:
Norman Feske 2019-03-01 19:27:40 +01:00
parent 434783da4d
commit 00ac29e53d

View File

@ -20,10 +20,12 @@ using namespace Sculpt;
void Popup_dialog::_gen_pkg_info(Xml_generator &xml,
Component const &component) const
{
gen_named_node(xml, "label", "info", [&] () {
xml.attribute("text", Component::Info(" ", component.info, " ")); });
if (component.info.length() > 1) {
gen_named_node(xml, "label", "info", [&] () {
xml.attribute("text", Component::Info(" ", component.info, " ")); });
_gen_info_label(xml, "pad1", "");
_gen_info_label(xml, "pad1", "");
}
_gen_info_label(xml, "path", component.path);
}