summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorangela <angela@lindenlab.com>2009-12-03 18:38:15 +0800
committerangela <angela@lindenlab.com>2009-12-03 18:38:15 +0800
commite8196ca93f24644998777da6b2286920c7709cbe (patch)
treebe61772afa075e4cfeee58823a6660347e35bad7 /indra/newview
parent1a75c4c49046b496829b41a49359002adc94b1a3 (diff)
EXT-2313 Add auto-close behavior to mini-inspector floater
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml13
-rw-r--r--indra/newview/llinspect.cpp21
-rw-r--r--indra/newview/llinspect.h3
3 files changed, 32 insertions, 5 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d9607e5f6b..fb1aac6e95 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3706,7 +3706,18 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>0.15</real>
+ <real>0.5</real>
+ </map>
+ <key>InspectorShowTime</key>
+ <map>
+ <key>Comment</key>
+ <string>Stay timing for inspectors</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>3.0</real>
</map>
<key>InstallLanguage</key>
<map>
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<F32> FADE_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f);
+ static LLCachedControl<F32> 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();
+}
diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h
index a461c2fa16..731e99534b 100644
--- a/indra/newview/llinspect.h
+++ b/indra/newview/llinspect.h
@@ -46,6 +46,9 @@ public:
/// Inspectors have a custom fade-in/fade-out animation
/*virtual*/ void draw();
+ /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
+ /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
+
/// Start open animation
/*virtual*/ void onOpen(const LLSD& avatar_id);