From b24dfb72c54ccf98b8854fa5270e0b28106ad5cb Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 11 May 2010 23:04:43 +0300 Subject: 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 --- indra/newview/llpaneleditwearable.cpp | 31 +++++- indra/newview/llpaneleditwearable.h | 3 + .../skins/default/xui/en/panel_edit_shape.xml | 61 +++--------- .../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("edit_alpha_panel"); mPanelTattoo = getChild("edit_tattoo_panel"); + mTxtAvatarHeight = mPanelShape->getChild("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" > - - - Gender: - - - - - - + width="310"> + [HEIGHT] Meters tall + + width="150" /> + + + + + + + + -- cgit v1.2.3