From 6b92b866e49408622ed02b85a0518b01cdbcf7a9 Mon Sep 17 00:00:00 2001
From: Denis Serdjuk <dserduk@productengine.com>
Date: Mon, 8 Feb 2010 20:01:52 +0200
Subject: [PATCH] fixed  Bug EXT-3777   	 inspector tool tips and UI tool tips
 do not have round corners Tooltip handler has been added to inspector
 floater. Default background image  of tooltip panel has been changed for
 inspector.

--HG--
branch : product-engine
---
 indra/newview/llinspect.cpp                   | 21 +++++++++++++++++++
 indra/newview/llinspect.h                     |  1 +
 .../default/xui/en/widgets/inspector.xml      |  2 +-
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp
index c7b651f37cd..81cfce53b19 100644
--- a/indra/newview/llinspect.cpp
+++ b/indra/newview/llinspect.cpp
@@ -32,6 +32,7 @@
 
 #include "llinspect.h"
 
+#include "lltooltip.h"
 #include "llcontrol.h"	// LLCachedControl
 #include "llui.h"		// LLUI::sSettingsGroups
 #include "llviewermenu.h"
@@ -104,6 +105,26 @@ BOOL LLInspect::handleHover(S32 x, S32 y, MASK mask)
 	return LLView::handleHover(x, y, mask);
 }
 
+BOOL LLInspect::handleToolTip(S32 x, S32 y, MASK mask)
+{
+	BOOL handled = FALSE;
+
+
+	//delegate handling of tooltip to the hovered child
+	LLView* child_handler = childFromPoint(x,y);
+	if (child_handler && !child_handler->getToolTip().empty())// show tooltip if a view has non-empty tooltip message
+	{
+		//build LLInspector params to get correct tooltip setting, etc. background image
+		LLInspector::Params params;
+		params.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());
+		params.message = child_handler->getToolTip();
+		//set up delay if there is no visible tooltip at this moment
+		params.delay_time =  LLToolTipMgr::instance().toolTipVisible() ? 0.f : LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" );
+		LLToolTipMgr::instance().show(params);
+		handled = TRUE;
+	}
+	return handled;
+}
 // virtual
 void LLInspect::onMouseLeave(S32 x, S32 y, MASK mask)
 {
diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h
index f8c86618d26..6d994a8d7c4 100644
--- a/indra/newview/llinspect.h
+++ b/indra/newview/llinspect.h
@@ -47,6 +47,7 @@ class LLInspect : public LLFloater
 	/*virtual*/ void draw();
 	
 	/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
+	/*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask);
 	/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
 	
 	/// Start open animation
diff --git a/indra/newview/skins/default/xui/en/widgets/inspector.xml b/indra/newview/skins/default/xui/en/widgets/inspector.xml
index 23f32253b6f..428b2ce03b0 100644
--- a/indra/newview/skins/default/xui/en/widgets/inspector.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inspector.xml
@@ -2,7 +2,7 @@
 <inspector name="inspector"
            bg_opaque_color="DkGray_66"
            background_visible="true"
-           bg_opaque_image="none"
+           bg_opaque_image="Inspector_Hover"
            background_opaque="true"
            bg_alpha_image="none"
            mouse_opaque="true" 
-- 
GitLab