summaryrefslogtreecommitdiff
path: root/indra/llui/llbutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llbutton.cpp')
-rw-r--r--indra/llui/llbutton.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index e6c045250e..30968225a8 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -56,7 +56,7 @@ static LLDefaultChildRegistry::Register<LLButton> r("button");
// Compiler optimization, generate extern template
template class LLButton* LLView::getChild<class LLButton>(
- const std::string& name, bool recurse) const;
+ std::string_view name, bool recurse) const;
// globals
S32 LLBUTTON_H_PAD = 4;
@@ -188,7 +188,7 @@ LLButton::LLButton(const LLButton::Params& p)
// Likewise, missing "p.button_flash_rate" is replaced by gSavedSettings.getF32("FlashPeriod").
// Note: flashing should be allowed in settings.xml (boolean key "EnableButtonFlashing").
S32 flash_count = p.button_flash_count.isProvided()? p.button_flash_count : 0;
- F32 flash_rate = p.button_flash_rate.isProvided()? p.button_flash_rate : 0.0;
+ F32 flash_rate = p.button_flash_rate.isProvided()? p.button_flash_rate : 0.0f;
mFlashingTimer = new LLFlashTimer ((LLFlashTimer::callback_t)NULL, flash_count, flash_rate);
}
else
@@ -796,9 +796,6 @@ void LLButton::draw()
if( ll::ui::SearchableControl::getHighlighted() )
label_color = ll::ui::SearchableControl::getHighlightColor();
- // Unselected label assignments
- LLWString label = getCurrentLabel();
-
// overlay with keyboard focus border
if (hasFocus())
{
@@ -927,8 +924,9 @@ void LLButton::draw()
}
// Draw label
- if( !label.empty() )
+ if( !getCurrentLabel().empty() ) // Unselected label assignments
{
+ LLWString label = getCurrentLabel();
LLWStringUtil::trim(label);
S32 x;
@@ -1082,10 +1080,10 @@ void LLButton::autoResize()
resize(getCurrentLabel());
}
-void LLButton::resize(LLUIString label)
+void LLButton::resize(const LLUIString& label)
{
// get label length
- S32 label_width = mGLFont->getWidth(label.getString());
+ S32 label_width = mGLFont->getWidth(label.getWString().c_str());
// get current btn length
S32 btn_width =getRect().getWidth();
// check if it need resize
@@ -1129,12 +1127,12 @@ void LLButton::setImageSelected(LLPointer<LLUIImage> image)
mImageSelected = image;
}
-void LLButton::setImageColor(const LLColor4& c)
+void LLButton::setImageColor(const LLUIColor& c)
{
mImageColor = c;
}
-void LLButton::setColor(const LLColor4& color)
+void LLButton::setColor(const LLUIColor& color)
{
setImageColor(color);
}
@@ -1273,7 +1271,7 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname)
// Set the button control value (toggle state) to the floater visibility control (Sets the value as well)
button->setControlVariable(LLFloater::getControlGroup()->getControl(vis_control_name));
// Set the clicked callback to toggle the floater
- button->setClickedCallback(boost::bind(&LLFloaterReg::toggleInstance, sdname, LLSD()));
+ button->setClickedCallback([=](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstance(sdname.asString(), LLSD()); });
}
// static