Fixed normal bug EXT-4379 (Scroller doesn't follow the cursor if cursor is being moved by keyboard arrow buttons)

--HG--
branch : product-engine
master
Eugene Mutavchi 2010-01-18 17:10:11 +02:00
parent fe37c59940
commit e8cbd586a9
3 changed files with 8 additions and 10 deletions

View File

@ -711,19 +711,12 @@ void LLFlatListView::selectLastItem ()
void LLFlatListView::ensureSelectedVisible()
{
LLRect visible_rc = getVisibleContentRect();
LLRect selected_rc = getLastSelectedItemRect();
if ( !visible_rc.contains (selected_rc) )
if ( selected_rc.isValid() )
{
// But scroll in Items panel coordinates
scrollToShowRect(selected_rc);
}
// In case we are in accordion tab notify parent to show selected rectangle
LLRect screen_rc;
localRectToScreen(selected_rc, &screen_rc);
notifyParent(LLSD().with("scrollToShowRect",screen_rc.getValue()));
}

View File

@ -668,6 +668,11 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& const
// propagate scroll to document
updateScroll();
// In case we are in accordion tab notify parent to show selected rectangle
LLRect screen_rc;
localRectToScreen(rect_to_constrain, &screen_rc);
notifyParent(LLSD().with("scrollToShowRect",screen_rc.getValue()));
}
void LLScrollContainer::pageUp(S32 overlap)

View File

@ -1885,8 +1885,8 @@ void LLFolderView::scrollToShowItem(LLFolderViewItem* item, const LLRect& constr
S32 icon_height = mIcon.isNull() ? 0 : mIcon->getHeight();
S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight());
// when navigating with keyboard, only move top of folders on screen, otherwise show whole folder
S32 max_height_to_show = mScrollContainer->hasFocus() ? (llmax( icon_height, label_height ) + ICON_PAD) : local_rect.getHeight();
// when navigating with keyboard, only move top of opened folder on screen, otherwise show whole folder
S32 max_height_to_show = item->isOpen() && mScrollContainer->hasFocus() ? (llmax( icon_height, label_height ) + ICON_PAD) : local_rect.getHeight();
// get portion of item that we want to see...
LLRect item_local_rect = LLRect(item->getIndentation(),