diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-03 16:08:44 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-03 16:08:44 +0000 |
commit | a171848fd4fed2fe915bcb42de96359112cf95e1 (patch) | |
tree | 5f4d85f4469f2d737864b3a07b367fa81040f3a3 /indra/newview/llinspect.cpp | |
parent | cc5920bed7790db49a062fb98ce54191f06ed98c (diff) | |
parent | fc70ca5403acdd99b2235dbf4e513a4dd806c850 (diff) |
merge from viewer2.
Diffstat (limited to 'indra/newview/llinspect.cpp')
-rw-r--r-- | indra/newview/llinspect.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp index c7b8db9635..c7b651f37c 100644 --- a/indra/newview/llinspect.cpp +++ b/indra/newview/llinspect.cpp @@ -34,6 +34,7 @@ #include "llcontrol.h" // LLCachedControl #include "llui.h" // LLUI::sSettingsGroups +#include "llviewermenu.h" LLInspect::LLInspect(const LLSD& key) : LLFloater(key), @@ -108,3 +109,26 @@ void LLInspect::onMouseLeave(S32 x, S32 y, MASK mask) { mOpenTimer.unpause(); } + +bool LLInspect::childHasVisiblePopupMenu() +{ + // Child text-box may spawn a pop-up menu, if mouse is over the menu, Inspector + // will hide(which is not expected). + // This is an attempt to find out if child control has spawned a menu. + + LLView* child_menu = gMenuHolder->getVisibleMenu(); + if(child_menu) + { + LLRect floater_rc = calcScreenRect(); + LLRect menu_screen_rc = child_menu->calcScreenRect(); + S32 mx, my; + LLUI::getMousePositionScreen(&mx, &my); + + // This works wrong if we spawn a menu near Inspector and menu overlaps Inspector. + if(floater_rc.overlaps(menu_screen_rc) && menu_screen_rc.pointInRect(mx, my)) + { + return true; + } + } + return false; +} |