mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 05:47:42 +00:00
General: Use std::make_unique where applicable
No behavior change.
This commit is contained in:
@@ -21,9 +21,10 @@ TextField::TextField(ViewResources& res, View& parentView, IStringBinding* strBi
|
||||
setInactive();
|
||||
m_vertsBinding.load<decltype(m_verts)>(m_verts);
|
||||
|
||||
m_text.reset(new TextView(res, *this, res.m_mainFont, TextView::Alignment::Left, 1024));
|
||||
if (strBind)
|
||||
m_text = std::make_unique<TextView>(res, *this, res.m_mainFont, TextView::Alignment::Left, 1024);
|
||||
if (strBind != nullptr) {
|
||||
setText(strBind->getDefault(this));
|
||||
}
|
||||
}
|
||||
|
||||
TextField::~TextField() = default;
|
||||
@@ -605,7 +606,7 @@ void TextField::setErrorState(std::string_view message) {
|
||||
clearSelectionRange();
|
||||
refreshBg();
|
||||
|
||||
m_errText.reset(new TextView(rootView().viewRes(), *this, rootView().viewRes().m_mainFont));
|
||||
m_errText = std::make_unique<TextView>(rootView().viewRes(), *this, rootView().viewRes().m_mainFont);
|
||||
m_errText->typesetGlyphs(message, rootView().themeData().uiText());
|
||||
|
||||
updateSize();
|
||||
|
||||
Reference in New Issue
Block a user