2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 17:47:42 +00:00

string_view refactor

This commit is contained in:
Jack Andersen
2017-11-12 20:14:52 -10:00
parent 4ba4022277
commit 1b7874a7b2
31 changed files with 216 additions and 196 deletions

View File

@@ -12,12 +12,12 @@ void Button::Resources::init(boo::IGraphicsDataFactory::Context& ctx, const IThe
}
Button::Button(ViewResources& res, View& parentView,
IButtonBinding* controlBinding, const std::string& text, Icon* icon,
IButtonBinding* controlBinding, std::string_view text, Icon* icon,
Style style, const zeus::CColor& bgColor, RectangleConstraint constraint)
: Button(res, parentView, controlBinding, text, res.themeData().uiText(), icon, style, bgColor, constraint) {}
Button::Button(ViewResources& res, View& parentView,
IButtonBinding* controlBinding, const std::string& text, const zeus::CColor& textColor,
IButtonBinding* controlBinding, std::string_view text, const zeus::CColor& textColor,
Icon* icon, Style style, const zeus::CColor& bgColor, RectangleConstraint constraint)
: Control(res, parentView, controlBinding),
m_style(style), m_textColor(textColor), m_bgColor(bgColor), m_textStr(text), m_constraint(constraint)
@@ -71,12 +71,12 @@ Button::Button(ViewResources& res, View& parentView,
setText(m_textStr);
}
void Button::setText(const std::string& text)
void Button::setText(std::string_view text)
{
setText(text, m_textColor);
}
void Button::setText(const std::string& text, const zeus::CColor& textColor)
void Button::setText(std::string_view text, const zeus::CColor& textColor)
{
m_textStr = text;
m_textColor = textColor;