diff options
Diffstat (limited to 'indra/newview/llfolderview.cpp')
-rw-r--r-- | indra/newview/llfolderview.cpp | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index c6135d3bc3..7d527fa98a 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -195,7 +195,8 @@ LLFolderView::LLFolderView(const Params& p) mCallbackRegistrar(NULL), mParentPanel(p.parent_panel), mUseEllipses(false), - mDraggingOverItem(NULL) + mDraggingOverItem(NULL), + mStatusTextBox(NULL) { LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); @@ -221,16 +222,34 @@ LLFolderView::LLFolderView(const Params& p) // Escape is handled by reverting the rename, not commiting it (default behavior) LLLineEditor::Params params; params.name("ren"); - params.rect(getRect()); + params.rect(rect); params.font(getLabelFontForStyle(LLFontGL::NORMAL)); params.max_length_bytes(DB_INV_ITEM_NAME_STR_LEN); params.commit_callback.function(boost::bind(&LLFolderView::commitRename, this, _2)); - params.prevalidate_callback(&LLLineEditor::prevalidateASCIIPrintableNoPipe); + params.prevalidate_callback(&LLTextValidate::validateASCIIPrintableNoPipe); params.commit_on_focus_lost(true); params.visible(false); mRenamer = LLUICtrlFactory::create<LLLineEditor> (params); addChild(mRenamer); + // Textbox + LLTextBox::Params text_p; + 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())); + text_p.rect(new_r); + text_p.name(std::string(p.name)); + text_p.font(font); + text_p.visible(false); + text_p.allow_html(true); + mStatusTextBox = LLUICtrlFactory::create<LLTextBox> (text_p); + mStatusTextBox->setFollowsLeft(); + mStatusTextBox->setFollowsTop(); + //addChild(mStatusTextBox); + + // make the popup menu available LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); if (!menu) @@ -253,6 +272,7 @@ LLFolderView::~LLFolderView( void ) mScrollContainer = NULL; mRenameItem = NULL; mRenamer = NULL; + mStatusTextBox = NULL; if( gEditMenuHandler == this ) { @@ -399,6 +419,11 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen S32 total_width = LEFT_PAD; S32 running_height = mDebugFilters ? llceil(LLFontGL::getFontMonospace()->getLineHeight()) : 0; S32 target_height = running_height; + if(!mHasVisibleChildren)// is there any filtered items ? + { + //Nope. We need to display status textbox, let's reserve some place for it + target_height += mStatusTextBox->getTextPixelHeight(); + } S32 parent_item_height = getRect().getHeight(); for (folders_t::iterator iter = mFolders.begin(); @@ -874,7 +899,7 @@ void LLFolderView::draw() LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } - LLFontGL* font = getLabelFontForStyle(mLabelStyle); + //LLFontGL* font = getLabelFontForStyle(mLabelStyle); // if cursor has moved off of me during drag and drop // close all auto opened folders @@ -911,19 +936,23 @@ void LLFolderView::draw() || mFilter->getShowFolderState() == LLInventoryFilter::SHOW_ALL_FOLDERS) { mStatusText.clear(); + mStatusTextBox->setVisible( FALSE ); } else { if (gInventory.backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration()) { mStatusText = LLTrans::getString("Searching"); - font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + //font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } else { mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage()); - font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + //font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } + mStatusTextBox->setValue(mStatusText); + mStatusTextBox->setVisible( TRUE ); + } LLFolderViewFolder::draw(); @@ -1272,8 +1301,7 @@ BOOL LLFolderView::canCut() const const LLFolderViewItem* item = *selected_it; const LLFolderViewEventListener* listener = item->getListener(); - // *WARKAROUND: it is too many places where the "isItemRemovable" method should be changed with "const" modifier - if (!listener || !(const_cast<LLFolderViewEventListener*>(listener))->isItemRemovable()) + if (!listener || !listener->isItemRemovable()) { return FALSE; } @@ -1608,7 +1636,11 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) LLFolderViewItem* parent_folder = last_selected->getParentFolder(); if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { - setSelection(parent_folder, FALSE, TRUE); + // Don't change selectin to hidden folder. See EXT-5328. + if (!parent_folder->getHidden()) + { + setSelection(parent_folder, FALSE, TRUE); + } } else { |