From dee48496166e44f0e9b13a6c0b348d3409ddf0e5 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 1 Dec 2009 11:26:43 -0800 Subject: EXT-2635 No message reminding user that a restart is required to reset cache (was Clear Cache) EXT-2652 Favorites bar drop-down button (for when favorites exceed width of viewer) is not configurable via XUI EXT-2227 [BSI] Preferences -> Setup -> Cache Location blank EXT-1036 Clicking menu separators selects wrong menu option (allows selection of greyed-out option) reviewed by James --- indra/llui/llmenugl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f8935d03ac..907f2352a0 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -590,12 +590,13 @@ BOOL LLMenuItemSeparatorGL::handleMouseDown(S32 x, S32 y, MASK mask) LLMenuGL* parent_menu = getMenu(); if (y > getRect().getHeight() / 2) { - LLView* prev_menu_item = parent_menu->findPrevSibling(this); + // the menu items are in the child list in bottom up order + LLView* prev_menu_item = parent_menu->findNextSibling(this); return prev_menu_item ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE; } else { - LLView* next_menu_item = parent_menu->findNextSibling(this); + LLView* next_menu_item = parent_menu->findPrevSibling(this); return next_menu_item ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE; } } @@ -605,12 +606,12 @@ BOOL LLMenuItemSeparatorGL::handleMouseUp(S32 x, S32 y, MASK mask) LLMenuGL* parent_menu = getMenu(); if (y > getRect().getHeight() / 2) { - LLView* prev_menu_item = parent_menu->findPrevSibling(this); + LLView* prev_menu_item = parent_menu->findNextSibling(this); return prev_menu_item ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE; } else { - LLView* next_menu_item = parent_menu->findNextSibling(this); + LLView* next_menu_item = parent_menu->findPrevSibling(this); return next_menu_item ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE; } } -- cgit v1.2.3 From eb7bba01d45d889ced072498cce2d4e73a719398 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 2 Dec 2009 16:02:43 -0800 Subject: EXT-2572 partial fix for nearby chat text clipping at the bottom Fixes 1 pixel of clipping caused by LLScrollContainer. Text is still clipped by 1 pixel, down from 2. Added more test text boxes to floater_test_textbox.xml Reviewed with Leyla. --- indra/llui/llscrollcontainer.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 53c5a8d07d..f6caed4617 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -111,7 +111,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) LLView::addChild( mBorder ); mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mInnerRect.stretch( -mBorder->getBorderWidth() ); + mInnerRect.stretch( -getBorderWidth() ); LLRect vertical_scroll_rect = mInnerRect; vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - scrollbar_size; @@ -189,7 +189,7 @@ void LLScrollContainer::reshape(S32 width, S32 height, LLUICtrl::reshape( width, height, called_from_parent ); mInnerRect = getLocalRect(); - mInnerRect.stretch( -mBorder->getBorderWidth() ); + mInnerRect.stretch( -getBorderWidth() ); if (mScrolledView) { @@ -351,9 +351,9 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height S32 doc_width = doc_rect.getWidth(); S32 doc_height = doc_rect.getHeight(); - S32 border_width = (mBorder->getVisible() ? 2 * mBorder->getBorderWidth() : 0); - *visible_width = getRect().getWidth() - border_width; - *visible_height = getRect().getHeight() - border_width; + S32 border_width = getBorderWidth(); + *visible_width = getRect().getWidth() - 2 * border_width; + *visible_height = getRect().getHeight() - 2 * border_width; *show_v_scrollbar = FALSE; *show_h_scrollbar = FALSE; @@ -499,7 +499,7 @@ void LLScrollContainer::updateScroll() BOOL show_h_scrollbar = FALSE; calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); - S32 border_width = mBorder->getBorderWidth(); + S32 border_width = getBorderWidth(); if( show_v_scrollbar ) { if( doc_rect.mTop < getRect().getHeight() - border_width ) @@ -573,6 +573,9 @@ void LLScrollContainer::updateScroll() void LLScrollContainer::setBorderVisible(BOOL b) { mBorder->setVisible( b ); + // Recompute inner rect, as border visibility changes it + mInnerRect = getLocalRect(); + mInnerRect.stretch( -getBorderWidth() ); } LLRect LLScrollContainer::getVisibleContentRect() @@ -593,7 +596,7 @@ LLRect LLScrollContainer::getContentWindowRect() BOOL show_h_scrollbar = FALSE; BOOL show_v_scrollbar = FALSE; calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); - S32 border_width = mBorder->getVisible() ? mBorder->getBorderWidth() : 0; + S32 border_width = getBorderWidth(); scroller_view_rect.setOriginAndSize(border_width, show_h_scrollbar ? mScrollbar[HORIZONTAL]->getRect().mTop : border_width, visible_width, @@ -626,7 +629,7 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& const rect_to_constrain.mTop - constraint.mTop); // translate from allowable region for lower left corner to upper left corner - allowable_scroll_rect.translate(0, content_window_rect.getHeight() - 1); + allowable_scroll_rect.translate(0, content_window_rect.getHeight()); S32 vert_pos = llclamp(mScrollbar[VERTICAL]->getDocPos(), mScrollbar[VERTICAL]->getDocSize() - allowable_scroll_rect.mTop, // min vertical scroll @@ -674,7 +677,7 @@ void LLScrollContainer::goToBottom() S32 LLScrollContainer::getBorderWidth() const { - if (mBorder) + if (mBorder->getVisible()) { return mBorder->getBorderWidth(); } -- cgit v1.2.3 From 6c2101a44e367496e6a0d289aa24164adaae3d1d Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 3 Dec 2009 09:32:05 -0800 Subject: EXT-2984 Fixed crash in LLNormalTextSegment::getDimensions (no repro) Avoid stepping off end of array when text segment has 0 characters Reviewed with Ambroff --- indra/llui/lltextbase.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index db16670f79..741ab1737d 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2397,12 +2397,20 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { - LLWString text = mEditor.getWText(); - height = mFontHeight; - width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); - // if last character is a newline, then return true, forcing line break - llwchar last_char = text[mStart + first_char + num_chars - 1]; + bool force_newline = false; + if (num_chars > 0) + { + LLWString text = mEditor.getWText(); + width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); + // if last character is a newline, then return true, forcing line break + llwchar last_char = text[mStart + first_char + num_chars - 1]; + force_newline = (last_char == '\n'); + } + else + { + width = 0; + } LLUIImagePtr image = mStyle->getImage(); if( image.notNull()) @@ -2411,7 +2419,7 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt height = llmax(height, image->getHeight()); } - return num_chars >= 1 && last_char == '\n'; + return force_newline; } S32 LLNormalTextSegment::getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const -- cgit v1.2.3 From 2fe5e55f4fe84e0ff2d2857355861657474daae8 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 3 Dec 2009 15:20:21 -0800 Subject: Hack for EXT-2971 Letter R doesn't show when it's the last letter in a text block. Add 1 pixel of padding to clipping rect computation. I think there is a deeper problem in the font width computation code, but I don't know where. Opened EXT-3112 for the deeper issue. Reviewed with Leyla. --- indra/llui/lltextbase.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 741ab1737d..82a3c5cf47 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -543,9 +543,17 @@ void LLTextBase::drawText() line_end = next_start; } + // A patch for EXT-1944 "Implement ellipses in message well" + // introduced a regression where text in SansSerif ending in the + // letter "r" is clipped. This may be due to an off-by-one in + // font width information out of FreeType with our fractional font + // sizes. For now, just make an extra pixel of space to resolve + // EXT-2971 "Letter R doesn't show when it's the last letter in a + // text block". See James/Richard for details. + const S32 FIX_CLIPPING_HACK = 1; LLRect text_rect(line.mRect.mLeft + mTextRect.mLeft - scrolled_view_rect.mLeft, line.mRect.mTop - scrolled_view_rect.mBottom + mTextRect.mBottom, - llmin(mDocumentView->getRect().getWidth(), line.mRect.mRight) - scrolled_view_rect.mLeft, + llmin(mDocumentView->getRect().getWidth(), line.mRect.mRight) - scrolled_view_rect.mLeft + FIX_CLIPPING_HACK, line.mRect.mBottom - scrolled_view_rect.mBottom + mTextRect.mBottom); // draw a single line of text -- cgit v1.2.3 From 58d65d58a90ab61f4fa317c829e96f9d24bbc65b Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 30 Dec 2009 15:34:30 -0800 Subject: EXT-2823 Find window: change default open location to the top-left of screen EXT-2921 [BSI] Default location for Screenshot Floater hides expanded options off screen reviewed by James --- indra/llui/llview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 23e4131e6d..6f8455774d 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2533,6 +2533,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) else { p.rect.left = p.rect.left + parent_rect.getWidth()/2 - p.rect.width/2; + p.rect.right.setProvided(false); // recalculate the right } } else @@ -2553,6 +2554,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) else { p.rect.bottom = p.rect.bottom + parent_rect.getHeight()/2 - p.rect.height/2; + p.rect.top.setProvided(false); // recalculate the top } } else -- cgit v1.2.3