Fix defaulted inventory folder floater title

This commit is contained in:
Lirusaito
2019-05-04 03:29:48 -04:00
parent 140f5d3b0a
commit f0ef3a4569

View File

@@ -40,7 +40,8 @@ LFFloaterInvPanel::LFFloaterInvPanel(const LLSD& cat, const std::string& name, L
mPanel->setEnabled(true);
addChild(mPanel);
removeChild(panel);
setTitle(name.empty() ? mPanel->getRootFolder()->getLabel() : name);
const auto& title = name.empty() ? mPanel->getRootFolder()->getName() : name;
setTitle(title);
// Figure out a unique name for our rect control
const auto rect_control = llformat("FloaterInv%sRect",
@@ -51,7 +52,7 @@ LFFloaterInvPanel::LFFloaterInvPanel(const LLSD& cat, const std::string& name, L
if (gSavedSettings.controlExists(rect_control)) // Set our initial rect to the stored control
setRect(gSavedSettings.getRect(rect_control));
else // Or create the rect control if it doesn't exist
gSavedSettings.declareRect(rect_control, getRect(), "Rectangle for " + getTitle() + " window");
gSavedSettings.declareRect(rect_control, getRect(), "Rectangle for " + title + " window");
setRectControl(rect_control);
}