From 74429f2ed926362a2ec47d590fc862b55b26f0f8 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 22 Jan 2010 13:42:52 +0200 Subject: =?UTF-8?q?fixed=20EXT-3670=20=E2=80=9CClicking=20on=20IM=20sessio?= =?UTF-8?q?n=20in=20IM=20session=20well=20closes=20IM=20floater=E2=80=9D,?= =?UTF-8?q?=20implemented=20exclude=20sets=20for=20groups=20of=20transient?= =?UTF-8?q?=20floaters,=20now=20transient=20floaters=20not=20closes=20if?= =?UTF-8?q?=20user=20click=20on=20view=20from=20global=20exclude=20set=20o?= =?UTF-8?q?r=20from=20floater=20group=20set;=20made=20IM=20floater=20goes?= =?UTF-8?q?=20foreground=20if=20it=20visible=20but=20not=20focused=20inste?= =?UTF-8?q?ad=20hide=20floater;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/lltransientfloatermgr.cpp | 69 ++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 23 deletions(-) (limited to 'indra/newview/lltransientfloatermgr.cpp') diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index 347399f239..f474f47eb7 100644 --- a/indra/newview/lltransientfloatermgr.cpp +++ b/indra/newview/lltransientfloatermgr.cpp @@ -44,57 +44,68 @@ LLTransientFloaterMgr::LLTransientFloaterMgr() { gViewerWindow->getRootView()->addMouseDownCallback(boost::bind( &LLTransientFloaterMgr::leftMouseClickCallback, this, _1, _2, _3)); + + mGroupControls.insert(std::pair >(GLOBAL, std::set())); + mGroupControls.insert(std::pair >(IM, std::set())); } -void LLTransientFloaterMgr::registerTransientFloater(LLFloater* floater) +void LLTransientFloaterMgr::registerTransientFloater(LLTransientFloater* floater) { mTransSet.insert(floater); } -void LLTransientFloaterMgr::unregisterTransientFloater(LLFloater* floater) +void LLTransientFloaterMgr::unregisterTransientFloater(LLTransientFloater* floater) { mTransSet.erase(floater); } +void LLTransientFloaterMgr::addControlView(ETransientGroup group, LLView* view) +{ + mGroupControls.find(group)->second.insert(view); +} + +void LLTransientFloaterMgr::removeControlView(ETransientGroup group, LLView* view) +{ + mGroupControls.find(group)->second.erase(view); +} + void LLTransientFloaterMgr::addControlView(LLView* view) { - mControlsSet.insert(view); + addControlView(GLOBAL, view); } void LLTransientFloaterMgr::removeControlView(LLView* view) { // we will still get focus lost callbacks on this view, but that's ok // since we run sanity checking logic every time - mControlsSet.erase(view); + removeControlView(GLOBAL, view); } -void LLTransientFloaterMgr::hideTransientFloaters() +void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y) { - for (std::set::iterator it = mTransSet.begin(); it + for (std::set::iterator it = mTransSet.begin(); it != mTransSet.end(); it++) { - LLFloater* floater = *it; - if (floater->isDocked()) + LLTransientFloater* floater = *it; + if (floater->isTransientDocked()) { - floater->setVisible(FALSE); + ETransientGroup group = floater->getGroup(); + + bool hide = isControlClicked(mGroupControls.find(group)->second, x, y); + if (hide) + { + floater->setTransientVisible(FALSE); + } } } } -void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y, - MASK mask) +bool LLTransientFloaterMgr::isControlClicked(std::set& set, S32 x, S32 y) { - bool hide = true; - for (controls_set_t::iterator it = mControlsSet.begin(); it - != mControlsSet.end(); it++) + bool res = true; + for (controls_set_t::iterator it = set.begin(); it + != set.end(); it++) { - // don't hide transient floater if any context menu opened - if (LLMenuGL::sMenuContainer->getVisibleMenu() != NULL) - { - hide = false; - break; - } - LLView* control_view = *it; if (!control_view->getVisible()) { @@ -105,14 +116,26 @@ void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y, // if click inside view rect if (rect.pointInRect(x, y)) { - hide = false; + res = false; break; } } + return res; +} + +void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y, + MASK mask) +{ + // don't hide transient floater if any context menu opened + if (LLMenuGL::sMenuContainer->getVisibleMenu() != NULL) + { + return; + } + bool hide = isControlClicked(mGroupControls.find(GLOBAL)->second, x, y); if (hide) { - hideTransientFloaters(); + hideTransientFloaters(x, y); } } -- cgit v1.2.3 From d18c46bc15dc1f42c4119a3af9e5284335333475 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 22 Jan 2010 14:47:51 +0200 Subject: win build fixed --HG-- branch : product-engine --- indra/newview/lltransientfloatermgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/lltransientfloatermgr.cpp') diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index f474f47eb7..8f1a738453 100644 --- a/indra/newview/lltransientfloatermgr.cpp +++ b/indra/newview/lltransientfloatermgr.cpp @@ -139,3 +139,9 @@ void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y, } } +void LLTransientFloater::init(LLFloater* thiz) +{ + // used since LLTransientFloater(this) can't be used in descendant constructor parameter initialization. + mFloater = thiz; +} + -- cgit v1.2.3