From 1bbd259f2d009a807a09aea15d01d0872f8b1cad Mon Sep 17 00:00:00 2001
From: richard <none@none>
Date: Wed, 6 Jan 2010 11:17:38 -0800
Subject: EXT-3878 - Menus disappear when UI Size is < 1.00 EXT-3647 -
 Auto-scrolling of IMs should resume when user types in chat EXT-3877 -
 Pinning two levels of menus prevents movement using arrow keys EXT-1303 -
 Hyperlink text wraps in the middle of a word

reviewed by James
---
 indra/llui/llconsole.cpp |  5 +++++
 indra/llui/llmenugl.cpp  | 55 ++++++++++++++++++++++++++----------------------
 2 files changed, 35 insertions(+), 25 deletions(-)

(limited to 'indra/llui')

diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index fa0abd55d0..7248581ec6 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -331,6 +331,11 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b
 		}
 
 		U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, TRUE);
+		if (drawable == 0)
+		{
+			// try again without wrapping on word boundaries
+			drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, FALSE);
+		}
 
 		if (drawable != 0)
 		{
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 2648cbf08d..527c0a1b87 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1143,37 +1143,41 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask )
 	if (!branch)
 		return LLMenuItemGL::handleKeyHere(key, mask);
 
-	if (getMenu()->getVisible() && branch->getVisible() && key == KEY_LEFT)
+	// an item is highlighted, my menu is open, and I have an active sub menu or we are in
+	// keyboard navigation mode
+	if (getHighlight() 
+		&& getMenu()->isOpen() 
+		&& (isActive() || LLMenuGL::getKeyboardMode()))
 	{
-		// switch to keyboard navigation mode
-		LLMenuGL::setKeyboardMode(TRUE);
-
-		BOOL handled = branch->clearHoverItem();
-		if (branch->getTornOff())
+		if (branch->getVisible() && key == KEY_LEFT)
 		{
-			((LLFloater*)branch->getParent())->setFocus(FALSE);
-		}
-		if (handled && getMenu()->getTornOff())
-		{
-			((LLFloater*)getMenu()->getParent())->setFocus(TRUE);
-		}
-		return handled;
-	}
+			// switch to keyboard navigation mode
+			LLMenuGL::setKeyboardMode(TRUE);
 
-	if (getHighlight() && 
-		getMenu()->isOpen() && 
-		key == KEY_RIGHT && !branch->getHighlightedItem())
-	{
-		// switch to keyboard navigation mode
-		LLMenuGL::setKeyboardMode(TRUE);
+			BOOL handled = branch->clearHoverItem();
+			if (branch->getTornOff())
+			{
+				((LLFloater*)branch->getParent())->setFocus(FALSE);
+			}
+			if (handled && getMenu()->getTornOff())
+			{
+				((LLFloater*)getMenu()->getParent())->setFocus(TRUE);
+			}
+			return handled;
+		}
 
-		LLMenuItemGL* itemp = branch->highlightNextItem(NULL);
-		if (itemp)
+		if (key == KEY_RIGHT && !branch->getHighlightedItem())
 		{
-			return TRUE;
+			// switch to keyboard navigation mode
+			LLMenuGL::setKeyboardMode(TRUE);
+
+			LLMenuItemGL* itemp = branch->highlightNextItem(NULL);
+			if (itemp)
+			{
+				return TRUE;
+			}
 		}
 	}
-
 	return LLMenuItemGL::handleKeyHere(key, mask);
 }
 
@@ -1431,7 +1435,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask)
 {
 	BOOL menu_open = getBranch()->getVisible();
 	// don't do keyboard navigation of top-level menus unless in keyboard mode, or menu expanded
-	if (getHighlight() && getMenu()->getVisible() && (isActive() || LLMenuGL::getKeyboardMode()))
+	if (getHighlight() && getMenu()->isOpen() && (isActive() || LLMenuGL::getKeyboardMode()))
 	{
 		if (key == KEY_LEFT)
 		{
@@ -2836,6 +2840,7 @@ BOOL LLMenuGL::handleScrollWheel( S32 x, S32 y, S32 clicks )
 	return TRUE;
 }
 
+
 void LLMenuGL::draw( void )
 {
 	if (mNeedsArrange)
-- 
cgit v1.2.3