diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f92fa1d56..81ed7cce9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3580,7 +3580,7 @@ void LLAppViewer::badNetworkHandler() std::string grid_support_msg = ""; if (!gHippoGridManager->getCurrentGrid()->getSupportUrl().empty()) { - grid_support_msg = "\n\nOr visit the gird support page at: \n " + grid_support_msg = "\n\nOr visit the grid support page at: \n " + gHippoGridManager->getCurrentGrid()->getSupportUrl(); } std::ostringstream message; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 7b01cee85..2106f4fcc 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -80,7 +80,7 @@ ///---------------------------------------------------------------------------- const S32 RENAME_WIDTH_PAD = 4; -const S32 RENAME_HEIGHT_PAD = 6; +const S32 RENAME_HEIGHT_PAD = 1; const S32 AUTO_OPEN_STACK_DEPTH = 16; const S32 MIN_ITEM_WIDTH_VISIBLE = LLFolderViewItem::ICON_WIDTH + LLFolderViewItem::ICON_PAD @@ -89,6 +89,9 @@ const S32 MIN_ITEM_WIDTH_VISIBLE = LLFolderViewItem::ICON_WIDTH + /*first few characters*/ 40; const S32 MINIMUM_RENAMER_WIDTH = 80; +// *TODO: move in params in xml if necessary. Requires modification of LLFolderView & LLInventoryPanel Params. +const S32 STATUS_TEXT_HPAD = 6; +const S32 STATUS_TEXT_VPAD = 8; enum { SIGNAL_NO_KEYBOARD_FOCUS = 1, @@ -102,30 +105,6 @@ void copy_selected_item(void* user_data); void open_selected_items(void* user_data); void properties_selected_items(void* user_data); void paste_items(void* user_data); -void renamer_focus_lost( LLFocusableElement* handler, void* user_data ); - -///---------------------------------------------------------------------------- -/// Class LLFolderViewItem -///---------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - //--------------------------------------------------------------------------- @@ -231,8 +210,9 @@ LLFolderView::LLFolderView( const std::string& name, mDragAndDropThisFrame(FALSE), mParentPanel(parent_view), mUseEllipses(FALSE), + mDraggingOverItem(NULL), + mStatusTextBox(NULL), mSearchType(1) - { mRoot = this; @@ -265,7 +245,17 @@ LLFolderView::LLFolderView( const std::string& name, mRenamer->setCommitOnFocusLost(TRUE); mRenamer->setVisible(FALSE); addChild(mRenamer); - + + LLFontGL* font = getLabelFontForStyle(mLabelStyle); + LLRect new_r = LLRect(rect.mLeft + ICON_PAD, + rect.mTop - TEXT_PAD, + rect.mRight, + rect.mTop - TEXT_PAD - llfloor(font->getLineHeight())); + mStatusTextBox = new LLTextBox(name, new_r, std::string(), font, false); + mStatusTextBox->setVisible(true); + mStatusTextBox->setHPad(STATUS_TEXT_HPAD); + mStatusTextBox->setVPad(STATUS_TEXT_VPAD); + mStatusTextBox->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP); // make the popup menu available LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_inventory.xml", parent_view); if (!menu) @@ -294,6 +284,7 @@ LLFolderView::~LLFolderView( void ) mScrollContainer = NULL; mRenameItem = NULL; mRenamer = NULL; + mStatusTextBox = NULL; mAutoOpenItems.removeAllNodes(); gIdleCallbacks.deleteFunction(idle, this); @@ -523,12 +514,12 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen } } - /*if(!mHasVisibleChildren)// is there any filtered items ? + if(!mHasVisibleChildren)// is there any filtered items ? { //Nope. We need to display status textbox, let's reserve some place for it running_height = mStatusTextBox->getTextPixelHeight(); target_height = running_height; - }*/ + } mRunningHeight = running_height; LLRect scroll_rect = mScrollContainer->getContentWindowRect(); @@ -961,20 +952,37 @@ void LLFolderView::draw() || mFilter->getShowFolderState() == LLInventoryFilter::SHOW_ALL_FOLDERS) { mStatusText.clear(); + mStatusTextBox->setVisible( FALSE ); } else if (mShowEmptyMessage) { - const LLFontGL* font = getLabelFontForStyle(mLabelStyle); static LLCachedControl sSearchStatusColor(gColors, "InventorySearchStatusColor", LLColor4::white ); if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration()) { mStatusText = std::string("Searching..."); // *TODO:translate - font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } else { mStatusText = std::string("No matching items found in inventory."); // *TODO:translate - font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + } + mStatusTextBox->setWrappedText(mStatusText); + mStatusTextBox->setVisible( TRUE ); + + // firstly reshape message textbox with current size. This is necessary to + // LLTextBox::getTextPixelHeight works properly + const LLRect local_rect = getLocalRect(); + mStatusTextBox->setShape(local_rect); + + // get preferable text height... + S32 pixel_height = mStatusTextBox->getTextPixelHeight(); + bool height_changed = local_rect.getHeight() != pixel_height; + if (height_changed) + { + // ... if it does not match current height, lets rearrange current view. + // This will indirectly call ::arrange and reshape of the status textbox. + // We should call this method to also notify parent about required rect. + // See EXT-7564, EXT-7047. + arrangeFromRoot(); } } @@ -1581,10 +1589,26 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) { if (next == last_selected) { + //special case for LLAccordionCtrl + if(notifyParent(LLSD().with("action","select_next")) > 0 )//message was processed + { + clearSelection(); + return TRUE; + } return FALSE; } setSelection( next, FALSE, TRUE ); } + else + { + //special case for LLAccordionCtrl + if(notifyParent(LLSD().with("action","select_next")) > 0 )//message was processed + { + clearSelection(); + return TRUE; + } + return FALSE; + } } scrollToShowSelection(); mSearchString.clear(); @@ -1629,6 +1653,13 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) { if (prev == this) { + // If case we are in accordion tab notify parent to go to the previous accordion + if(notifyParent(LLSD().with("action","select_prev")) > 0 )//message was processed + { + clearSelection(); + return TRUE; + } + return FALSE; } setSelection( prev, FALSE, TRUE ); @@ -1959,6 +1990,8 @@ void LLFolderView::deleteAllChildren() mScrollContainer = NULL; mRenameItem = NULL; mRenamer = NULL; + mStatusTextBox = NULL; + clearSelection(); LLView::deleteAllChildren(); } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index c6ee590df..ebb0cb1aa 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -331,6 +331,8 @@ protected: public: static F32 sAutoOpenTime; + LLTextBox* mStatusTextBox; + }; bool sort_item_name(LLFolderViewItem* a, LLFolderViewItem* b); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 3a3b61264..83889fb4a 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -852,7 +852,6 @@ void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { std::vector items; std::vector disabled_items; - //items.push_back(std::string("Task Open")); // *TODO: Translate hide_context_entries(menu, items, disabled_items); } @@ -912,21 +911,17 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_GESTURE: case DAD_CALLINGCARD: case DAD_MESH: - // *HACK: In order to resolve SL-22177, we need to block - // drags from notecards and objects onto other - // objects. uncomment the simpler version when we have - // that right. accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data); // testzone //if(LLToolDragAndDrop::isInventoryDropAcceptable( // object, (LLViewerInventoryItem*)cargo_data) - if(object->permModify() + /*if(object->permModify() // && (LLToolDragAndDrop::SOURCE_WORLD != LLToolDragAndDrop::getInstance()->getSource()) && (LLToolDragAndDrop::SOURCE_NOTECARD != LLToolDragAndDrop::getInstance()->getSource())) { accept = TRUE; - } + }*/ if(accept && drop) { LLToolDragAndDrop::dropInventory(object,