|
|
|
@ -461,6 +461,20 @@ void UIWidget::applyStyle(const OTMLNodePtr& styleNode)
|
|
|
|
|
|
|
|
|
|
m_loadingStyle = true;
|
|
|
|
|
try {
|
|
|
|
|
// translate ! style tags
|
|
|
|
|
for(const OTMLNodePtr& node : styleNode->children()) {
|
|
|
|
|
if(node->tag()[0] == '!') {
|
|
|
|
|
std::string tag = node->tag().substr(1);
|
|
|
|
|
std::string code = Fw::formatString("tostring(%s)", node->value().c_str());
|
|
|
|
|
std::string origin = "@" + node->source() + "[" + node->tag() + "]";
|
|
|
|
|
g_lua.evaluateExpression(code, origin);
|
|
|
|
|
std::string value = g_lua.popString();
|
|
|
|
|
|
|
|
|
|
node->setTag(tag);
|
|
|
|
|
node->setValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onStyleApply(styleNode->tag(), styleNode);
|
|
|
|
|
callLuaField("onStyleApply", styleNode->tag(), styleNode);
|
|
|
|
|
|
|
|
|
@ -471,7 +485,6 @@ void UIWidget::applyStyle(const OTMLNodePtr& styleNode)
|
|
|
|
|
focus();
|
|
|
|
|
}
|
|
|
|
|
m_firstOnStyle = false;
|
|
|
|
|
|
|
|
|
|
} catch(Exception& e) {
|
|
|
|
|
logError("Failed to apply style to widget '", m_id, "' style: ", e.what());
|
|
|
|
|
}
|
|
|
|
|