diff options
| author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-05-11 23:04:43 +0300 | 
|---|---|---|
| committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-05-11 23:04:43 +0300 | 
| commit | b24dfb72c54ccf98b8854fa5270e0b28106ad5cb (patch) | |
| tree | 116b817b619791c3ac7710927a4ac0fab61ac027 /indra | |
| parent | 1ec883e456449ecf8d1d25ae3a78286748d46f6b (diff) | |
EXT-7206 FIXED Shape editing panel: implemented displaying avatar height in meters.
Changes:
- Now displaying (continuously refreshed) avatar height in the shape editing panel.
- Updated avatar avatar sex switching radio buttons according to the spec (icons, size, position).
- Fixed position, text and font color of the "Shape:" label.
Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/367/
--HG--
branch : product-engine
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llpaneleditwearable.cpp | 31 | ||||
| -rw-r--r-- | indra/newview/llpaneleditwearable.h | 3 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_edit_shape.xml | 61 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_edit_wearable.xml | 110 | 
4 files changed, 126 insertions, 79 deletions
| diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 3c112b8b5e..5526e6b7be 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -635,6 +635,8 @@ BOOL LLPanelEditWearable::postBuild()  	mPanelAlpha = getChild<LLPanel>("edit_alpha_panel");  	mPanelTattoo = getChild<LLPanel>("edit_tattoo_panel"); +	mTxtAvatarHeight = mPanelShape->getChild<LLTextBox>("avatar_height"); +  	mWearablePtr = NULL;  	return TRUE; @@ -661,7 +663,9 @@ void LLPanelEditWearable::draw()  	updateVerbs();  	if (getWearable())  	{ -		updatePanelPickerControls(getWearable()->getType()); +		EWearableType type = getWearable()->getType(); +		updatePanelPickerControls(type); +		updateTypeSpecificControls(type);  	}  	LLPanel::draw(); @@ -864,6 +868,9 @@ void LLPanelEditWearable::initializePanel()  	// set name  	mTextEditor->setText(mWearablePtr->getName()); +	// toggle wearable type-specific controls +	toggleTypeSpecificControls(type); +  	// clear and rebuild visual param list  	const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(type);  	if (!wearable_entry) @@ -922,6 +929,28 @@ void LLPanelEditWearable::initializePanel()  	updateVerbs();  } +void LLPanelEditWearable::toggleTypeSpecificControls(EWearableType type) +{ +	// Toggle controls specific to shape editing panel. +	{ +		bool is_shape = (type == WT_SHAPE); +		childSetVisible("sex_radio", is_shape); +		childSetVisible("female_icon", is_shape); +		childSetVisible("male_icon", is_shape); +	} +} + +void LLPanelEditWearable::updateTypeSpecificControls(EWearableType type) +{ +	// Update controls specific to shape editing panel. +	if (type == WT_SHAPE) +	{ +		// Update avatar height +		std::string avatar_height_str = llformat("%.2f", gAgentAvatarp->mBodySize.mV[VZ]); +		mTxtAvatarHeight->setTextArg("[HEIGHT]", avatar_height_str); +	} +} +  void LLPanelEditWearable::updateScrollingPanelUI()  {  	// do nothing if we don't have a valid wearable we're editing diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 76b0ddb3cc..35c5ddade1 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -80,6 +80,8 @@ private:  	void				onColorSwatchCommit(const LLUICtrl*);  	void				onTexturePickerCommit(const LLUICtrl*);  	void				updatePanelPickerControls(EWearableType type); +	void				toggleTypeSpecificControls(EWearableType type); +	void				updateTypeSpecificControls(EWearableType type);  	// the pointer to the wearable we're editing. NULL means we're not editing a wearable.  	LLWearable *mWearablePtr; @@ -91,6 +93,7 @@ private:  	LLTextBox *mPanelTitle;  	LLTextBox *mDescTitle; +	LLTextBox *mTxtAvatarHeight;  	// This text editor reference will change each time we edit a new wearable -  diff --git a/indra/newview/skins/default/xui/en/panel_edit_shape.xml b/indra/newview/skins/default/xui/en/panel_edit_shape.xml index e1c574001a..76842e5279 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_shape.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_shape.xml @@ -8,54 +8,19 @@  	 name="edit_shape_panel"  	 top_pad="10"  	 width="333" > -	 <panel -		 border="false" -         bg_alpha_color="DkGray2" -         bg_opaque_color="DkGray2" -         background_visible="true" -         background_opaque="true" +	 <text  		 follows="top|left|right" -		 height="50" -		 left="10" +		 font="SansSerifSmallBold" +		 halign="right" +		 height="12"  		 layout="topleft" -		 name="avatar_sex_panel" +		 left="0" +		 name="avatar_height" +		 text_color="EmphasisColor"  		 top="0" -		 width="313" > -   			<text  -			 follows="top|left" -			 height="16" -			 layout="topleft" -			 left="10" -			 name="gender_text" -			 width="313"> -				Gender: -			</text> -		   <radio_group -			 follows="left|top|right" -			 left="10" -             height="28" -             layout="topleft" -             name="sex_radio" -			 top_pad="3" -			 width="303" > -                <radio_item -					follows="all" -                 height="16" -                 label="Female" -                 layout="topleft" -                 left="10" -                 name="radio" -                 width="82" /> -                <radio_item -					follows="all" -                 height="16" -                 label="Male" -                 layout="topleft" -                 left_pad="10" -                 name="radio2" -                 width="82" /> -            </radio_group> -	 </panel> +		 width="310"> +		 [HEIGHT] Meters tall +	 </text>       <panel           border="false"           bg_alpha_color="DkGray2" @@ -63,17 +28,17 @@           background_visible="true"           background_opaque="true"           follows="all" -         height="345" +         height="388"           label="Shirt"           layout="topleft"  		 left="10"           name="accordion_panel" -		 top_pad="10" +		 top_pad="0"           width="313">  	 <accordion          layout="topleft"  		follows="all" -		height ="345" +		height ="388"  		left="0"  		name="wearable_accordion"  		top="0" diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index dc2f085356..afcd4550ca 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -165,12 +165,59 @@ left="0"           width="313">  		 <text  		 follows="top|left|right" +		 font="SansSerifSmallBold"  		 height="16"  		 layout="topleft"  		 left="10"  		 name="description_text" +		 text_color="white" +		 top="10"  		 value="Shape:" -		 width="303" /> +		 width="150" /> +		 <radio_group +			 follows="left|top|right" +			 left="210" +			 height="20" +			 layout="topleft" +			 name="sex_radio" +			 top="5" +			 width="110"> +			 <radio_item +				 follows="all" +				 height="16" +				 label="" +				 layout="topleft" +				 left="0" +				 name="sex_male" +				 tool_tip="Male" +				 width="40" /> +			 <radio_item +				 follows="all" +				 height="16" +				 label="" +				 layout="topleft" +				 left_pad="10" +				 name="sex_female" +				 tool_tip="Female" +				 width="40" /> +		 </radio_group> +		 <!--  graphical labels for the radio buttons above --> +		 <icon +			 height="16" +			 image_name="icons/Male.png" +			 left="230" +			 name="male_icon" +			 tool_tip="Male" +			 top="7" +			 width="16" /> +		 <icon +			 height="16" +			 image_name="icons/Female.png" +			 name="female_icon" +			 left="280" +			 tool_tip="Female" +			 top="7" +			 width="16" />  		 <text_editor  			 follows="all"  			 height="23" @@ -178,6 +225,7 @@ left="0"  			 layout="topleft"  			 max_length="300"  			 name="description" +			 top_pad="3"  			 width="290" />  	 </panel>  	 <panel @@ -186,8 +234,10 @@ left="0"  		 layout="topleft"  		 left="0"  		 name="edit_subpanel_container" -		 top_pad="10" +		 top_pad="2"  		 width="333"> +		 <!-- the shape editing panel is taller than the others +		      because it also displays avatar height -->  		 <panel  			 filename="panel_edit_shape.xml"  			 follows="all" @@ -201,141 +251,141 @@ left="0"  		 <panel  			 filename="panel_edit_skin.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_skin_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_hair.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_hair_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_eyes.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_eyes_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_shirt.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_shirt_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_pants.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_pants_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_shoes.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_shoes_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_socks.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_socks_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_jacket.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_jacket_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_skirt.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_skirt_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_gloves.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_gloves_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_undershirt.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_undershirt_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_underpants.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_underpants_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_alpha.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_alpha_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  		 <panel  			 filename="panel_edit_tattoo.xml"  			 follows="all" -			 height="400" +			 height="392"  			 layout="topleft"  			 left="0"  			 name="edit_tattoo_panel" -			 top="0" +			 top="8"  			 visible="false"  			 width="333" />  	 </panel> | 
