From 7781d8ea4043b671252a8dbdb17b567b656a841f Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Wed, 23 Nov 2011 21:09:31 +0100 Subject: [PATCH] - fixed : clicking the "Chat" toolbar button doesn't close the nearby chat floater if it's hosted --HG-- branch : Chat-NearbyChat --- indra/llui/llfloaterreg.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 7f56d86fdc..d8ae5b8131 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -502,21 +502,25 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& instance->openFloater(key); instance->setVisibleAndFrontmost(); } - else if (!instance->isFrontmost()) - { - instance->setVisibleAndFrontmost(); - } +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-11-23 (Catznip-3.2.0b) | Modified: Catznip-3.2.0b else { -// instance->closeFloater(); -// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-11-17 (Catznip-3.2.0a) | Added: Catznip-3.2.0a - // When toggling *visibility*, close the host instead of the floater when hosted - if (instance->getHost()) - instance->getHost()->closeFloater(); + // Give focus to, or close, the host rather than the floater when hosted + LLFloater* floaterp = (!instance->getHost()) ? instance : instance->getHost(); + if (!floaterp->isFrontmost()) + floaterp->setVisibleAndFrontmost(); else - instance->closeFloater(); -// [/SL:KB] + floaterp->closeFloater(); } +// [/SL:KB] +// else if (!instance->isFrontmost()) +// { +// instance->setVisibleAndFrontmost(); +// } +// else +// { +// instance->closeFloater(); +// } } // static