diff options
author | Merov Linden <merov@lindenlab.com> | 2012-08-23 20:02:43 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-08-23 20:02:43 -0700 |
commit | b19e6c295972c83a2637a29007bc5d0a92711ea9 (patch) | |
tree | b9df565b6ec84ff6c55097431392ec792a6dc0cb /indra/llui | |
parent | e537d6477dfa1eea86dc16c767b793fb530d1ebc (diff) | |
parent | 6d84272d38a4d09819ae03f4d967195ec3bd660b (diff) |
Pull merge from richard/viewer-chui
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfolderview.cpp | 43 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 70 | ||||
-rw-r--r-- | indra/llui/tests/llurlentry_stub.cpp | 5 |
3 files changed, 59 insertions, 59 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index f57790aff6..11004fe390 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -288,7 +288,7 @@ void LLFolderView::addFolder( LLFolderViewFolder* folder) //{ // mFolders.insert(mFolders.begin(), folder); //} -} + } void LLFolderView::closeAllFolders() { @@ -311,7 +311,7 @@ void LLFolderView::openTopLevelFolders() // *width should be 0 // conform show folder state works S32 LLFolderView::arrange( S32* unused_width, S32* unused_height ) - { + { mMinWidth = 0; S32 target_height; @@ -340,7 +340,7 @@ void LLFolderView::filter( LLFolderViewFilter& filter ) filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); getViewModelItem()->filter(filter); - } +} void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) { @@ -761,8 +761,8 @@ void LLFolderView::removeSelectedItems() { // change selection on successful delete setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus()); + } } - } arrangeAll(); } else if (count > 1) @@ -858,7 +858,7 @@ void LLFolderView::propertiesSelectedItems( void ) // multi_propertiesp->openFloater(LLSD()); // } //} - } +} void LLFolderView::autoOpenItem( LLFolderViewFolder* item ) @@ -1718,14 +1718,13 @@ void LLFolderView::update() // filter to determine visibility before arranging filter(getFolderViewModel()->getFilter()); - // Clear the modified setting on the filter only if the filter count is non-zero after running the filter process // Note: if the filter count is zero, then the filter most likely halted before completing the entire set of items if (getFolderViewModel()->getFilter().isModified() && (getFolderViewModel()->getFilter().getFilterCount() > 0)) { getFolderViewModel()->getFilter().clearModified(); } - + // automatically show matching items, and select first one if we had a selection if (mNeedsAutoSelect) { @@ -2033,31 +2032,31 @@ void LLFolderView::onRenamerLost() } } -S32 LLFolderView::getItemHeight() -{ - if(!hasVisibleChildren()) -{ - //We need to display status textbox, let's reserve some place for it - return llmax(0, mStatusTextBox->getTextPixelHeight()); -} - return 0; -} - LLFolderViewItem* LLFolderView::getNextUnselectedItem() { LLFolderViewItem* last_item = *mSelectedItems.rbegin(); LLFolderViewItem* new_selection = last_item->getNextOpenNode(FALSE); while(new_selection && new_selection->isSelected()) -{ + { new_selection = new_selection->getNextOpenNode(FALSE); -} + } if (!new_selection) -{ + { new_selection = last_item->getPreviousOpenNode(FALSE); while (new_selection && (new_selection->isInSelection())) - { + { new_selection = new_selection->getPreviousOpenNode(FALSE); + } } -} return new_selection; } + +S32 LLFolderView::getItemHeight() +{ + if(!hasVisibleChildren()) +{ + //We need to display status textbox, let's reserve some place for it + return llmax(0, mStatusTextBox->getTextPixelHeight()); +} + return 0; +} diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index b172359851..52923389cd 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -117,7 +117,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) if (mViewModelItem) { mViewModelItem->setFolderViewItem(this); - } +} } BOOL LLFolderViewItem::postBuild() @@ -219,11 +219,11 @@ void LLFolderViewItem::refresh() mIconOpen = vmi.getIconOpen(); mIconOverlay = vmi.getIconOverlay(); - if (mRoot->useLabelSuffix()) - { + if (mRoot->useLabelSuffix()) + { mLabelStyle = vmi.getLabelStyle(); mLabelSuffix = vmi.getLabelSuffix(); - } +} //TODO RN: make sure this logic still fires //std::string searchable_label(mLabel); @@ -253,7 +253,7 @@ void LLFolderViewItem::arrangeAndSet(BOOL set_selection, LLFolderView* root = getRoot(); if (getParentFolder()) { - getParentFolder()->requestArrange(); + getParentFolder()->requestArrange(); } if(set_selection) { @@ -365,12 +365,12 @@ void LLFolderViewItem::selectItem(void) BOOL LLFolderViewItem::isMovable() { return getViewModelItem()->isItemMovable(); -} + } BOOL LLFolderViewItem::isRemovable() { return getViewModelItem()->isItemRemovable(); - } +} void LLFolderViewItem::destroyView() { @@ -400,14 +400,14 @@ BOOL LLFolderViewItem::remove() void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags) { getViewModelItem()->buildContextMenu(menu, flags); -} + } void LLFolderViewItem::openItem( void ) { if (mAllowOpen) { getViewModelItem()->openItem(); -} + } } void LLFolderViewItem::rename(const std::string& new_name) @@ -421,7 +421,7 @@ void LLFolderViewItem::rename(const std::string& new_name) const std::string& LLFolderViewItem::getName( void ) const { return getViewModelItem()->getName(); -} + } // LLView functionality BOOL LLFolderViewItem::handleRightMouseDown( S32 x, S32 y, MASK mask ) @@ -484,7 +484,7 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) if( (x - mDragStartX) * (x - mDragStartX) + (y - mDragStartY) * (y - mDragStartY) > drag_and_drop_threshold() * drag_and_drop_threshold() && root->getCurSelectedItem() && root->startDrag()) - { + { // RN: when starting drag and drop, clear out last auto-open root->autoOpenTest(NULL); root->setShowSelectionContext(TRUE); @@ -496,7 +496,7 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) getWindow()->setCursor(UI_CURSOR_ARROW); return TRUE; - } + } else { getWindow()->setCursor(UI_CURSOR_NOLOCKED); @@ -758,7 +758,7 @@ void LLFolderViewItem::draw() LLUIImage* box_image = default_params.selection_image; LLRect box_rect(left, top, right, bottom); box_image->draw(box_rect, sFilterBGColor); - } + } LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor; //TODO RN: implement this in terms of getColor() @@ -785,15 +785,15 @@ void LLFolderViewItem::draw() //--------------------------------------------------------------------------------// // Highlight string match // - if (filter_string_length > 0) - { + if (filter_string_length > 0) + { F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, mViewModelItem->getFilterStringOffset()); - F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; + F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; font->renderUTF8( combined_string, mViewModelItem->getFilterStringOffset(), match_string_left, yy, - sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - filter_string_length, S32_MAX, &right_x, FALSE ); + sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, + filter_string_length, S32_MAX, &right_x, FALSE ); + } } -} const LLFolderViewModelInterface* LLFolderViewItem::getFolderViewModel( void ) const { @@ -1384,7 +1384,7 @@ void LLFolderViewFolder::destroyView() } LLFolderViewItem::destroyView(); -} + } // extractItem() removes the specified item from the folder, but // doesn't delete it. @@ -1418,7 +1418,7 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) BOOL LLFolderViewFolder::isMovable() { if( !(getViewModelItem()->isItemMovable()) ) - { + { return FALSE; } @@ -1448,7 +1448,7 @@ BOOL LLFolderViewFolder::isMovable() BOOL LLFolderViewFolder::isRemovable() { if( !(getViewModelItem()->isItemRemovable()) ) - { + { return FALSE; } @@ -1478,7 +1478,7 @@ BOOL LLFolderViewFolder::isRemovable() void LLFolderViewFolder::addItem(LLFolderViewItem* item) { if (item->getParentFolder()) - { +{ item->getParentFolder()->extractItem(item); } item->setParentFolder(this); @@ -1487,10 +1487,10 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item) item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); item->setVisible(FALSE); - + addChild(item); getViewModelItem()->addChild(item->getViewModelItem()); - + //TODO RN - make sort bubble up as long as parent Folder doesn't have anything matching sort criteria //// Traverse parent folders and update creation date and resort, if necessary //LLFolderViewFolder* parentp = this; @@ -1508,11 +1508,11 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item) // this is an internal method used for adding items to folders. void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) -{ - if (folder->mParentFolder) { + if (folder->mParentFolder) + { folder->mParentFolder->extractItem(folder); - } + } folder->mParentFolder = this; mFolders.push_back(folder); folder->setOrigin(0, 0); @@ -1524,20 +1524,20 @@ void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) addChild( folder ); getViewModelItem()->addChild(folder->getViewModelItem()); -} + } void LLFolderViewFolder::requestArrange() { //if ( mLastArrangeGeneration != -1) { - mLastArrangeGeneration = -1; - // flag all items up to root - if (mParentFolder) - { - mParentFolder->requestArrange(); + mLastArrangeGeneration = -1; + // flag all items up to root + if (mParentFolder) + { + mParentFolder->requestArrange(); + } } } -} void LLFolderViewFolder::toggleOpen() { diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index ee87d01239..f8797fd257 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -40,9 +40,10 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) return false; } -void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot) +LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot) { - return; + callback_connection_t connection; + return connection; } bool LLAvatarNameCache::useDisplayNames() |