summaryrefslogtreecommitdiff
path: root/indra/llui/lltoggleablemenu.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-10-27 15:08:21 -0400
committerLoren Shih <seraph@lindenlab.com>2010-10-27 15:08:21 -0400
commit225ffbba205e832b75bed3492428ae3a0c8c7404 (patch)
tree510681690c0c3c5e2504739453873c7ed701c658 /indra/llui/lltoggleablemenu.cpp
parent1aee2f0d4d16548660df4995aaf3c349304962af (diff)
parenta7143a9998f2a69d323d384558e078b05e9a73a2 (diff)
Automated merge up from viewer-development
Diffstat (limited to 'indra/llui/lltoggleablemenu.cpp')
-rw-r--r--indra/llui/lltoggleablemenu.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp
index 0eb2dc1387..d29260750f 100644
--- a/indra/llui/lltoggleablemenu.cpp
+++ b/indra/llui/lltoggleablemenu.cpp
@@ -35,10 +35,22 @@ static LLDefaultChildRegistry::Register<LLToggleableMenu> r("toggleable_menu");
LLToggleableMenu::LLToggleableMenu(const LLToggleableMenu::Params& p)
: LLMenuGL(p),
mButtonRect(),
+ mVisibilityChangeSignal(NULL),
mClosedByButtonClick(false)
{
}
+LLToggleableMenu::~LLToggleableMenu()
+{
+ delete mVisibilityChangeSignal;
+}
+
+boost::signals2::connection LLToggleableMenu::setVisibilityChangeCallback(const commit_signal_t::slot_type& cb)
+{
+ if (!mVisibilityChangeSignal) mVisibilityChangeSignal = new commit_signal_t();
+ return mVisibilityChangeSignal->connect(cb);
+}
+
// virtual
void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn)
{
@@ -49,6 +61,12 @@ void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn)
{
mClosedByButtonClick = true;
}
+
+ if (mVisibilityChangeSignal)
+ {
+ (*mVisibilityChangeSignal)(this,
+ LLSD().with("visibility", curVisibilityIn).with("closed_by_button_click", mClosedByButtonClick));
+ }
}
void LLToggleableMenu::setButtonRect(const LLRect& rect, LLView* current_view)