From 0b0372a3037b9fa1f411180232644b6c9f373319 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 5 Jan 2010 15:49:22 -0800 Subject: EXT-3900 [BSI] Inspector floater fades while inspectors context menu is still active reviewed by Richard --- indra/llui/llmenubutton.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h index 02eb9d3806..d0e99d9f40 100644 --- a/indra/llui/llmenubutton.h +++ b/indra/llui/llmenubutton.h @@ -55,6 +55,7 @@ public: /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ); void hideMenu(); + LLMenuGL* getMenu() { return mMenu; } protected: friend class LLUICtrlFactory; -- cgit v1.2.3 From a3adfe54cb9fc953cae0adf2f61c578aa3ca5842 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 5 Jan 2010 16:28:22 -0800 Subject: EXT-3332 Disabled checkboxes don't use disabled text color Text label color wasn't being set in constructor. Added example to floater_test_widgets.xml Reviewed with Richard --- indra/llui/llcheckboxctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index cd10dfdb1c..3d32157406 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -107,8 +107,8 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p) { tbparams.font(p.font); } + tbparams.text_color( p.enabled() ? p.text_enabled_color() : p.text_disabled_color() ); mLabel = LLUICtrlFactory::create (tbparams); - addChild(mLabel); // Button -- cgit v1.2.3 From 1bbd259f2d009a807a09aea15d01d0872f8b1cad Mon Sep 17 00:00:00 2001 From: richard 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 From 49660730308fb6d5301d1617402a353a21e9d9be Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 6 Jan 2010 12:23:56 -0800 Subject: moved clipping logic inside LLFontGL::maxDrawableChars controlled by EWordWrapStyle fixes regression introduced in 3eef5ce9ae1e6fc62b9b52ce859501dd4e70fadf reviewed by Brad --- indra/llui/llconsole.cpp | 7 +------ indra/llui/lltextbase.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 7248581ec6..f69e935754 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -330,12 +330,7 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b skip_chars = 0; } - 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); - } + U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); if (drawable != 0) { diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7447a984ac..5ebf49c488 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2509,10 +2509,15 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin // set max characters to length of segment, or to first newline max_chars = llmin(max_chars, last_char - (mStart + segment_offset)); + // if no character yet displayed on this line, don't require word wrapping since + // we can just move to the next line, otherwise insist on it so we make forward progress + LLFontGL::EWordWrapStyle word_wrap_style = (line_offset == 0) + ? LLFontGL::WORD_BOUNDARY_IF_POSSIBLE + : LLFontGL::ONLY_WORD_BOUNDARIES; S32 num_chars = mStyle->getFont()->maxDrawableChars(text.c_str() + segment_offset + mStart, (F32)num_pixels, max_chars, - TRUE); + word_wrap_style); if (num_chars == 0 && line_offset == 0 -- cgit v1.2.3