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.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 219c2ee254..f28fca35c5 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -52,6 +52,7 @@
#include "llrender.h"
#include "lluictrlfactory.h"
#include "llhelp.h"
+#include "lldockablefloater.h"
static LLDefaultChildRegistry::Register<LLButton> r("button");
@@ -1057,6 +1058,20 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname)
}
// static
+void LLButton::setDockableFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname)
+{
+ LLButton* button = dynamic_cast<LLButton*>(ctrl);
+ if (!button)
+ return;
+ // Get the visibility control name for the floater
+ std::string vis_control_name = LLFloaterReg::declareVisibilityControl(sdname.asString());
+ // Set the button control value (toggle state) to the floater visibility control (Sets the value as well)
+ button->setControlVariable(LLUI::sSettingGroups["floater"]->getControl(vis_control_name));
+ // Set the clicked callback to toggle the floater
+ button->setClickedCallback(boost::bind(&LLDockableFloater::toggleInstance, sdname));
+}
+
+// static
void LLButton::showHelp(LLUICtrl* ctrl, const LLSD& sdname)
{
// search back through the button's parents for a panel