replace kWidget enum with string

This commit is contained in:
2019-12-01 21:42:40 +01:00
parent 94cf227704
commit afb26e8321
4 changed files with 39 additions and 114 deletions

View File

@@ -92,16 +92,8 @@ bool LayoutManager::parse(const std::string& xml_string) noexcept
if (p == m_layouts.end())
{
auto& node = m_layouts[id];
kWidget node_id = (kWidget)const_hash(current->Name());
switch (node_id)
{
case kWidget::Border:
node.reset(new NodeBorder());
break;
default:
node.reset(new Node());
break;
}
std::string node_name = current->Name();
node.reset(node_name == "border" ? new NodeBorder : new Node);
node->set_manager(this);
// try to copy the old size values
if (old.count(id))