diff options
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llaccordionctrl.cpp | 24 | ||||
| -rw-r--r-- | indra/llui/llscrollingpanellist.cpp | 28 | ||||
| -rw-r--r-- | indra/llui/llscrollingpanellist.h | 6 | ||||
| -rw-r--r-- | indra/llui/llurlentry.cpp | 29 | ||||
| -rw-r--r-- | indra/llui/llurlentry.h | 12 | ||||
| -rw-r--r-- | indra/llui/llurlregistry.cpp | 1 | 
6 files changed, 95 insertions, 5 deletions
| diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 2ed1082f56..cdcf780d2e 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -372,11 +372,33 @@ void	LLAccordionCtrl::arrangeSinge()  		}  		else  		{ -			panel_height = expanded_height; +			if(mFitParent) +			{ +				panel_height = expanded_height; +			} +			else +			{ +				if(accordion_tab->getAccordionView()) +				{ +					panel_height = accordion_tab->getAccordionView()->getRect().getHeight() +  +						accordion_tab->getHeaderHeight() + 2*BORDER_MARGIN; +				} +				else +				{ +					panel_height = accordion_tab->getRect().getHeight(); +				} +			}  		} + +		// make sure at least header is shown +		panel_height = llmax(panel_height, accordion_tab->getHeaderHeight()); +  		ctrlSetLeftTopAndSize(mAccordionTabs[i], panel_left, panel_top, panel_width, panel_height);  		panel_top-=mAccordionTabs[i]->getRect().getHeight();  	} + +	show_hide_scrollbar(getRect().getWidth(), getRect().getHeight()); +	updateLayout(getRect().getWidth(), getRect().getHeight());  }  void	LLAccordionCtrl::arrangeMultiple() diff --git a/indra/llui/llscrollingpanellist.cpp b/indra/llui/llscrollingpanellist.cpp index 4f55c0507c..b7840d1b59 100644 --- a/indra/llui/llscrollingpanellist.cpp +++ b/indra/llui/llscrollingpanellist.cpp @@ -47,7 +47,12 @@ void LLScrollingPanelList::clearPanels()  {  	deleteAllChildren();  	mPanelList.clear(); -	reshape( 1, 1, FALSE ); + +	LLRect rc = getRect(); +	rc.setLeftTopAndSize(rc.mLeft, rc.mTop, 1, 1); +	setRect(rc); + +	notifySizeChanged(rc.getHeight());  }  S32 LLScrollingPanelList::addPanel( LLScrollingPanel* panel ) @@ -67,7 +72,11 @@ S32 LLScrollingPanelList::addPanel( LLScrollingPanel* panel )  		max_width = llmax( max_width, childp->getRect().getWidth() );  		cur_gap = GAP_BETWEEN_PANELS;  	} -	reshape( max_width, total_height, FALSE ); + 	LLRect rc = getRect(); + 	rc.setLeftTopAndSize(rc.mLeft, rc.mTop, max_width, total_height); + 	setRect(rc); + +	notifySizeChanged(rc.getHeight());  	// Reposition each of the child views  	S32 cur_y = total_height; @@ -131,7 +140,11 @@ void LLScrollingPanelList::removePanel( U32 panel_index )  		max_width = llmax( max_width, childp->getRect().getWidth() );  		cur_gap = GAP_BETWEEN_PANELS;  	} -	reshape( max_width, total_height, FALSE ); +	LLRect rc = getRect(); +	rc.setLeftTopAndSize(rc.mLeft, rc.mTop, max_width, total_height); +	setRect(rc); + +	notifySizeChanged(rc.getHeight());  	// Reposition each of the child views  	S32 cur_y = total_height; @@ -200,3 +213,12 @@ void LLScrollingPanelList::draw()  	LLUICtrl::draw();  } +void LLScrollingPanelList::notifySizeChanged(S32 height) +{ +	LLSD info; +	info["action"] = "size_changes"; +	info["height"] = height; +	notifyParent(info); +} + +// EOF diff --git a/indra/llui/llscrollingpanellist.h b/indra/llui/llscrollingpanellist.h index 3abfbcbbe7..5f1996159b 100644 --- a/indra/llui/llscrollingpanellist.h +++ b/indra/llui/llscrollingpanellist.h @@ -61,7 +61,6 @@ public:  		Params()  		{  			name = "scrolling_panel_list"; -			follows.flags = FOLLOWS_LEFT | FOLLOWS_BOTTOM;  		}  	};  	LLScrollingPanelList(const Params& p) @@ -86,6 +85,11 @@ public:  private:  	void				updatePanelVisiblilty(); +	/** +	 * Notify parent about size change, makes sense when used inside accordion +	 */ +	void				notifySizeChanged(S32 height); +  	panel_list_t		mPanelList;  }; diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index c38e38c900..d7666ca4c3 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -499,6 +499,35 @@ std::string LLUrlEntryInventory::getLabel(const std::string &url, const LLUrlLab  	return LLURI::unescape(label.empty() ? url : label);  } +// +// LLUrlEntryObjectIM Describes a Second Life inspector for the object Url, e.g., +// secondlife:///app/objectim/7bcd7864-da6b-e43f-4486-91d28a28d95b?name=Object&owner=3de548e1-57be-cfea-2b78-83ae3ad95998&slurl=Danger!%20Danger!/200/200/30/&groupowned=1 +// +LLUrlEntryObjectIM::LLUrlEntryObjectIM() +{ +	mPattern = boost::regex("secondlife:///app/objectim/[\\da-f-]+\?.*", +							boost::regex::perl|boost::regex::icase); +	mMenuName = "menu_url_objectim.xml"; +} + +std::string LLUrlEntryObjectIM::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ +	LLURI uri(url); +	LLSD query_map = uri.queryMap(); +	if (query_map.has("name")) +		return query_map["name"]; +	return unescapeUrl(url); +} + +std::string LLUrlEntryObjectIM::getLocation(const std::string &url) const +{ +	LLURI uri(url); +	LLSD query_map = uri.queryMap(); +	if (query_map.has("slurl")) +		return query_map["slurl"]; +	return LLUrlEntryBase::getLocation(url); +} +  ///  /// LLUrlEntryParcel Describes a Second Life parcel Url, e.g.,  /// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 84d0968779..29575d752c 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -201,6 +201,18 @@ public:  private:  }; +/// +/// LLUrlEntryObjectIM Describes a Second Life inspector for the object Url, e.g., +/// secondlife:///app/objectim/7bcd7864-da6b-e43f-4486-91d28a28d95b?name=Object&owner=3de548e1-57be-cfea-2b78-83ae3ad95998&slurl=Danger!%20Danger!/200/200/30/&groupowned=1 +/// +class LLUrlEntryObjectIM : public LLUrlEntryBase +{ +public: +	LLUrlEntryObjectIM(); +	/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); +	/*virtual*/ std::string getLocation(const std::string &url) const; +private: +};  ///  /// LLUrlEntryParcel Describes a Second Life parcel Url, e.g., diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index faa02e1904..7e09a5a919 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -55,6 +55,7 @@ LLUrlRegistry::LLUrlRegistry()  	registerUrl(new LLUrlEntryWorldMap());  	registerUrl(new LLUrlEntryPlace());  	registerUrl(new LLUrlEntryInventory()); +	registerUrl(new LLUrlEntryObjectIM());  	//LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern,   	//so it should be registered in the end of list  	registerUrl(new LLUrlEntrySL()); | 
