1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-05 15:55:45 +00:00

Allow widgets with layout-type tooltip to change user data of widgets from tooltip layout

This commit is contained in:
MiroslavR 2014-08-16 13:24:44 +02:00
parent a9f7a30d90
commit 236eec3d89

View File

@ -238,12 +238,23 @@ namespace MWGui
size_t underscorePos = it->first.find("_");
if (underscorePos == std::string::npos)
continue;
std::string propertyKey = it->first.substr(0, underscorePos);
std::string key = it->first.substr(0, underscorePos);
std::string widgetName = it->first.substr(underscorePos+1, it->first.size()-(underscorePos+1));
std::string type = "Property";
size_t caretPos = key.find("^");
if (caretPos != std::string::npos)
{
type = key.substr(0, caretPos);
key.erase(key.begin(), key.begin() + caretPos + 1);
}
MyGUI::Widget* w;
getWidget(w, widgetName);
w->setProperty(propertyKey, it->second);
if (type == "Property")
w->setProperty(key, it->second);
else if (type == "UserData")
w->setUserString(key, it->second);
}
tooltipSize = tooltip->getSize();