diff options
author | angela <angela@lindenlab.com> | 2010-02-03 13:56:39 +0800 |
---|---|---|
committer | angela <angela@lindenlab.com> | 2010-02-03 13:56:39 +0800 |
commit | 460ec67b97bc210c0a03483dd0b754e92fabe806 (patch) | |
tree | 90bd49da9c7e23e6b90ebf04b8fcc9847b4f414e /indra/newview/llinspect.cpp | |
parent | 1094fa28c618370af9a95cf823cbd9287c92dd24 (diff) | |
parent | 86923afd27d76734cf1274fa788928230c232a4d (diff) |
resolve merge in llsidepanelinventory.cpp
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; +} |