From 20e56a6925b4d4106059a73a22170beb5a38be1e Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 13 Oct 2009 16:25:48 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1992 https://svn.aws.productengine.com/secondlife/pe/stable-2@2004 -> viewer-2.0.0-3 * Bugs: EXT-1091 EXT-1418 EXT-996 EXT-1150 EXT-1188 EXT-1417 EXT-1181 EXT-1058 EXT-1397 EXT-836 EXT-1437 EXT-1379 * Dev: EXT-1291 EXT-1255 EXT-992 EXT-96 EXT-1157 --- indra/llui/llbutton.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/llui/llbutton.cpp') 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 r("button"); @@ -1056,6 +1057,20 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname) button->setClickedCallback(boost::bind(&LLFloaterReg::toggleFloaterInstance, sdname)); } +// static +void LLButton::setDockableFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname) +{ + LLButton* button = dynamic_cast(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) { -- cgit v1.2.3