diff options
| -rw-r--r-- | indra/newview/llfolderviewitem.cpp | 32 | ||||
| -rw-r--r-- | indra/newview/llimfloatercontainer.cpp | 15 | ||||
| -rw-r--r-- | indra/newview/llimfloatercontainer.h | 4 | 
3 files changed, 32 insertions, 19 deletions
| diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 73715c78df..0800e0baa2 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -377,7 +377,10 @@ void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection,  											BOOL openitem,  											BOOL take_keyboard_focus)  { -	getRoot()->setSelection(selection, openitem, take_keyboard_focus); +	if (getRoot()) +	{ +		getRoot()->setSelection(selection, openitem, take_keyboard_focus); +	}  }  // helper function to change the selection from the root. @@ -754,7 +757,10 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )  	}  	else  	{ -		getRoot()->setShowSelectionContext(FALSE); +		if (getRoot()) +		{ +			getRoot()->setShowSelectionContext(FALSE); +		}  		gViewerWindow->setCursor(UI_CURSOR_ARROW);  		// let parent handle this then...  		return FALSE; @@ -797,7 +803,10 @@ BOOL LLFolderViewItem::handleMouseUp( S32 x, S32 y, MASK mask )  	if( hasMouseCapture() )  	{ -		getRoot()->setShowSelectionContext(FALSE); +		if (getRoot()) +		{ +			getRoot()->setShowSelectionContext(FALSE); +		}  		gFocusMgr.setMouseCapture( NULL );  	}  	return TRUE; @@ -864,8 +873,9 @@ void LLFolderViewItem::draw()  	const S32 FOCUS_LEFT = 1;  	const LLFontGL* font = getLabelFontForStyle(mLabelStyle); -	const BOOL in_inventory = getListener() && getListener()->getUUID().notNull() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getRootFolderID()); -	const BOOL in_library = getListener() && getListener()->getUUID().notNull() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getLibraryRootFolderID()); +	const LLUUID uuid = (getListener() ? getListener()->getUUID() : LLUUID::null); +	const BOOL in_inventory = (uuid.notNull() ? gInventory.isObjectDescendentOf(uuid, gInventory.getRootFolderID()) : FALSE); +	const BOOL in_library   = (uuid.notNull() ? gInventory.isObjectDescendentOf(uuid, gInventory.getLibraryRootFolderID()) : FALSE);  	//--------------------------------------------------------------------------------//  	// Draw open folder arrow @@ -885,8 +895,8 @@ void LLFolderViewItem::draw()  	//--------------------------------------------------------------------------------//  	// Draw highlight for selected items  	// -	const BOOL show_context = getRoot()->getShowSelectionContext(); -	const BOOL filled = show_context || (getRoot()->getParentPanel()->hasFocus()); // If we have keyboard focus, draw selection filled +	const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE); +	const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled  	const S32 focus_top = getRect().getHeight();  	const S32 focus_bottom = getRect().getHeight() - mItemHeight;  	const bool folder_open = (getRect().getHeight() > mItemHeight + 4); @@ -897,8 +907,8 @@ void LLFolderViewItem::draw()  		if (!mIsCurSelection)  		{  			// do time-based fade of extra objects -			F32 fade_time = getRoot()->getSelectionFadeElapsedTime(); -			if (getRoot()->getShowSingleSelection()) +			F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f); +			if (getRoot() && getRoot()->getShowSingleSelection())  			{  				// fading out  				bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, bg_color.mV[VALPHA], 0.f); @@ -1009,7 +1019,7 @@ void LLFolderViewItem::draw()  	//--------------------------------------------------------------------------------//  	// Highlight filtered text  	// -	if (getRoot()->getDebugFilters()) +	if (getRoot() && getRoot()->getDebugFilters())  	{  		if (!getFiltered() && !possibly_has_children)  		{ @@ -1070,7 +1080,7 @@ void LLFolderViewItem::draw()  	if (mStringMatchOffset != std::string::npos)  	{  		// don't draw backgrounds for zero-length strings -		S32 filter_string_length = getRoot()->getFilterSubString().size(); +		S32 filter_string_length = (getRoot() ? getRoot()->getFilterSubString().size() : 0);  		if (filter_string_length > 0)  		{  			std::string combined_string = mLabel + mLabelSuffix; diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 134d345148..cd19105860 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -115,19 +115,22 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,  	LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);  	// CHUI-137 -	llinfos << "Merov debug : addFloater, title = " << floaterp->getTitle() << llendl;  	// Create a conversation item -	LLConversationItem item(floaterp->getTitle()); -	// Add it to the list +	LLConversationItem* item = new LLConversationItem(floaterp->getTitle());  	mConversationsItems.push_back(item);  	// Create a widget from it -	LLFolderViewItem* widget = createConversationItemWidget(&item); -	// Add it to the list of widgets +	LLFolderViewItem* widget = createConversationItemWidget(item);  	mConversationsWidgets.push_back(widget);  	// Add it to the UI  	widget->setVisible(TRUE);  	mConversationsListPanel->addChild(widget); -	// Reposition it... +	LLRect panel_rect = mConversationsListPanel->getRect(); +	S32 item_height = 16; +	S32 index = mConversationsWidgets.size() - 1; +	widget->setRect(LLRect(0, +						   panel_rect.getHeight() - item_height*index, +						   panel_rect.getWidth(), +						   panel_rect.getHeight() - item_height*(index+1)));  	// CHUI-137 : end  	LLView* floater_contents = floaterp->getChild<LLView>("contents_view"); diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 5cfdb41ad3..d04ac873fa 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -46,7 +46,7 @@ class LLTabContainer;  // CHUI-137 : Temporary implementation of conversations list  class LLConversationItem; -typedef std::list<LLConversationItem> conversations_items_list_t; +typedef std::list<LLConversationItem*> conversations_items_list_t;  typedef std::list<LLFolderViewItem*> conversations_widgets_list_t;  // Conversation items: we hold a list of those and create an LLFolderViewItem widget for each that we tuck  @@ -110,7 +110,7 @@ public:  							std::string& tooltip_msg) { return FALSE; }  private:  	std::string mName; -	LLUUID mUUID; +	const LLUUID mUUID;  };  	// CHUI-137 : End | 
