diff options
author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-02-02 14:25:31 +0200 |
---|---|---|
committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-02-02 14:25:31 +0200 |
commit | 38315a063d83bf4dbf90569dbe37a344d91349a7 (patch) | |
tree | 25eb74272dd682706667118d4aee8aecff24cc87 | |
parent | c679ae3546ffe0f29330a2969460fa37807e23b6 (diff) |
Fixed normal bug EXT-4740 - Object inspector hides however context menu present
--HG--
branch : product-engine
-rw-r--r-- | indra/llui/lltextbase.cpp | 10 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 1 | ||||
-rw-r--r-- | indra/newview/llinspect.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llinspect.h | 3 | ||||
-rw-r--r-- | indra/newview/llinspectavatar.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llinspectobject.cpp | 11 |
6 files changed, 57 insertions, 5 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 259522a932..b977e50bc1 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1024,6 +1024,16 @@ void LLTextBase::setReadOnlyColor(const LLColor4 &c) } //virtual +void LLTextBase::handleVisibilityChange( BOOL new_visibility ) +{ + if(!new_visibility && mPopupMenu) + { + mPopupMenu->hide(); + } + LLUICtrl::handleVisibilityChange(new_visibility); +} + +//virtual void LLTextBase::setValue(const LLSD& value ) { setText(value.asString()); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index b5c7fab67a..ed2f239476 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -122,6 +122,7 @@ public: /*virtual*/ BOOL acceptsTextInput() const { return !mReadOnly; } /*virtual*/ void setColor( const LLColor4& c ); virtual void setReadOnlyColor(const LLColor4 &c); + virtual void handleVisibilityChange( BOOL new_visibility ); /*virtual*/ void setValue(const LLSD& value ); /*virtual*/ LLTextViewModel* getViewModel() const; 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; +} diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h index a1cb9cd71c..f8c86618d2 100644 --- a/indra/newview/llinspect.h +++ b/indra/newview/llinspect.h @@ -56,6 +56,9 @@ public: /*virtual*/ void onFocusLost(); protected: + + virtual bool childHasVisiblePopupMenu(); + LLFrameTimer mCloseTimer; LLFrameTimer mOpenTimer; }; diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 3a41aebf28..b2cdc0738f 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -393,11 +393,18 @@ void LLInspectAvatar::onMouseLeave(S32 x, S32 y, MASK mask) { LLMenuGL* gear_menu = getChild<LLMenuButton>("gear_btn")->getMenu(); LLMenuGL* gear_menu_self = getChild<LLMenuButton>("gear_self_btn")->getMenu(); - if ( !(gear_menu && gear_menu->getVisible()) && - !(gear_menu_self && gear_menu_self->getVisible())) + if ( gear_menu && gear_menu->getVisible() && + gear_menu_self && gear_menu_self->getVisible() ) { - mOpenTimer.unpause(); + return; + } + + if(childHasVisiblePopupMenu()) + { + return; } + + mOpenTimer.unpause(); } void LLInspectAvatar::updateModeratorPanel() diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index dd313c528d..1a5795a2ae 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -575,10 +575,17 @@ void LLInspectObject::updateSecureBrowsing() void LLInspectObject::onMouseLeave(S32 x, S32 y, MASK mask) { LLMenuGL* gear_menu = getChild<LLMenuButton>("gear_btn")->getMenu(); - if ( !(gear_menu && gear_menu->getVisible())) + if ( gear_menu && gear_menu->getVisible() ) { - mOpenTimer.unpause(); + return; + } + + if(childHasVisiblePopupMenu()) + { + return; } + + mOpenTimer.unpause(); } void LLInspectObject::onClickBuy() |