From e8196ca93f24644998777da6b2286920c7709cbe Mon Sep 17 00:00:00 2001 From: angela Date: Thu, 3 Dec 2009 18:38:15 +0800 Subject: EXT-2313 Add auto-close behavior to mini-inspector floater --- indra/newview/llinspect.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinspect.cpp') diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp index aa299014ee..c7b8db9635 100644 --- a/indra/newview/llinspect.cpp +++ b/indra/newview/llinspect.cpp @@ -50,16 +50,16 @@ LLInspect::~LLInspect() void LLInspect::draw() { static LLCachedControl FADE_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f); + static LLCachedControl STAY_TIME(*LLUI::sSettingGroups["config"], "InspectorShowTime", 1.f); if (mOpenTimer.getStarted()) { - F32 alpha = clamp_rescale(mOpenTimer.getElapsedTimeF32(), 0.f, FADE_TIME, 0.f, 1.f); - LLViewDrawContext context(alpha); LLFloater::draw(); - if (alpha == 1.f) + if (mOpenTimer.getElapsedTimeF32() > STAY_TIME) { mOpenTimer.stop(); + mCloseTimer.start(); } - + } else if (mCloseTimer.getStarted()) { @@ -95,3 +95,16 @@ void LLInspect::onFocusLost() mCloseTimer.start(); mOpenTimer.stop(); } + +// virtual +BOOL LLInspect::handleHover(S32 x, S32 y, MASK mask) +{ + mOpenTimer.pause(); + return LLView::handleHover(x, y, mask); +} + +// virtual +void LLInspect::onMouseLeave(S32 x, S32 y, MASK mask) +{ + mOpenTimer.unpause(); +} -- cgit v1.2.3