From 176b025a26e11fa9133a4a4c9fbc2cfa4f7cf616 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 4 Mar 2011 19:10:54 +0200
Subject: [PATCH] STORM-236 WIP Additional fixes.

Fixed:
* Wrong ability to place a button between the chat input and the drag handle (thanks Wolfpup!).
* Broken drag-n-drop cursors.
---
 indra/newview/llbottomtray.cpp | 15 +++++++++++----
 indra/newview/llbottomtray.h   |  1 +
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 7139b0ea0e5..d8ec4b605c1 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -72,9 +72,6 @@ BOOL LLBottomtrayButton::handleHover(S32 x, S32 y, MASK mask)
 		localPointToScreen(x, y, &screenX, &screenY);
 		LLBottomTray::getInstance()->onDraggableButtonHover(screenX, screenY);
 
-		// Reset cursor in case you move your mouse from the drag handle to a button.
-		getWindow()->setCursor(UI_CURSOR_ARROW);
-
 		return TRUE;
 	}
 	else
@@ -204,6 +201,7 @@ LLBottomTray::LLBottomTray(const LLSD&)
 	mSpeakBtn(NULL),
 	mNearbyChatBar(NULL),
 	mChatBarContainer(NULL),
+	mNearbyCharResizeHandlePanel(NULL),
 	mToolbarStack(NULL),
 	mMovementButton(NULL),
 	mResizeState(RS_NORESIZE),
@@ -554,6 +552,7 @@ BOOL LLBottomTray::postBuild()
 	LLHints::registerHintTarget("chat_bar", mNearbyChatBar->LLView::getHandle());
 
 	mChatBarContainer = getChild<LLLayoutPanel>("chat_bar_layout_panel");
+	mNearbyCharResizeHandlePanel = getChild<LLPanel>("chat_bar_resize_handle_panel");
 
 	mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
 	mMovementButton = getChild<LLButton>("movement_btn");
@@ -672,12 +671,20 @@ void LLBottomTray::onDraggableButtonHover(S32 x, S32 y)
 			gViewerWindow->getWindow()->setCursor(UI_CURSOR_NO);
 		}
 	}
+	else
+	{
+		// Reset cursor in case you move your mouse from the drag handle to a button.
+		getWindow()->setCursor(UI_CURSOR_ARROW);
+
+	}
 }
 
 bool LLBottomTray::isCursorOverDraggableArea(S32 x, S32 y)
 {
+	// Draggable area lasts from the nearby chat input resize handle
+	// to the chiclet area (exlusively).
 	bool result = getRect().pointInRect(x, y);
-	result = result && mNearbyChatBar->calcScreenRect().mRight < x;
+	result = result && mNearbyCharResizeHandlePanel->calcScreenRect().mRight < x;
 	result = result && mChicletPanel->calcScreenRect().mRight > x;
 	return result;
 }
diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h
index 76d80b8e0b9..04e5f5e9e07 100644
--- a/indra/newview/llbottomtray.h
+++ b/indra/newview/llbottomtray.h
@@ -469,6 +469,7 @@ class LLBottomTray
 	LLSpeakButton* 		mSpeakBtn;
 	LLNearbyChatBar*	mNearbyChatBar;
 	LLLayoutPanel*		mChatBarContainer;
+	LLPanel*		mNearbyCharResizeHandlePanel;
 	LLLayoutStack*		mToolbarStack;
 	LLMenuGL*			mBottomTrayContextMenu;
 	LLButton*			mCamButton;
-- 
GitLab