From 0a50de9b67973f88f608b3d4013a8453c73b8c77 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 24 Jun 2010 13:12:40 +0300 Subject: EXT-8007 FIXED updated heights and pads (wearables panel on panel outfit edit) Reviwed by Neal Orman at https://codereview.productengine.com/secondlife/r/645/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 4abd7dceac..fde48d6ba3 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -318,13 +318,13 @@ It is calculated as border_size + 2*UIResizeBarOverlap background_visible="false" border="false" follows="left|top|right|bottom" - height="442" + height="449" layout="topleft" left="0" mouse_opaque="false" name="folder_view" - top_pad="5" - width="310" + top_pad="0" + width="313" visible="false"/> -- cgit v1.2.3 From c99bfaf6ed7bf280a3355c10630a66f5c5affbc1 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 24 Jun 2010 13:16:35 +0300 Subject: EXT-7961 FIXED Added possibility to show label on the back button in Edit Wearables panel. Implemented behavior: * Normally Back button appears narrow without label * When wearable is changed - "Save" label is set and button gets wide. Left Border of Title is moved to the right. Note: "Save" label is shown without truncation in all languages, Title can be truncated with dots. * When changes are saved/reverted - label is removed, button shrinks, Title left border is moved to the its default place. * Added consistent tooltip for title (the same as a title). * Added tooltip for button: "Save changes if necessary and return back" Details: * added getter for button's font * implemented derived from LLButton class for Back button to enable setting necessary label's padding in xml Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/636/ --HG-- branch : product-engine --- indra/llui/llbutton.h | 2 + indra/newview/llpaneleditwearable.cpp | 50 ++++++++++++++++++++++ indra/newview/llpaneleditwearable.h | 1 + indra/newview/skins/default/textures/textures.xml | 6 +-- .../skins/default/xui/en/panel_edit_wearable.xml | 13 ++++-- 5 files changed, 66 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index d7ab030a47..f4af19b696 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -230,6 +230,8 @@ public: void setFont(const LLFontGL *font) { mGLFont = ( font ? font : LLFontGL::getFontSansSerif()); } + const LLFontGL* getFont() const { return mGLFont; } + S32 getLastDrawCharsCount() const { return mLastDrawCharsCount; } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index ae54909945..5c85ea849e 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -382,6 +382,31 @@ LLEditWearableDictionary::PickerControlEntry::PickerControlEntry(ETextureIndex t { } +/** + * Class to prevent hack in LLButton's constructor and use paddings declared in xml. + */ +class LLLabledBackButton : public LLButton +{ +public: + struct Params : public LLInitParam::Block + { + Params() {} + }; +protected: + friend class LLUICtrlFactory; + LLLabledBackButton(const Params&); +}; + +static LLDefaultChildRegistry::Register labeled_back_btn("labeled_back_button"); + +LLLabledBackButton::LLLabledBackButton(const Params& params) +: LLButton(params) +{ + // override hack in LLButton's constructor to use paddings have been set in xml + setLeftHPad(params.pad_left); + setRightHPad(params.pad_right); +} + // Helper functions. static const texture_vec_t null_texture_vec; @@ -649,6 +674,8 @@ BOOL LLPanelEditWearable::postBuild() mBtnRevert->setClickedCallback(boost::bind(&LLPanelEditWearable::onRevertButtonClicked, this)); mBtnBack = getChild("back_btn"); + mBackBtnLabel = mBtnBack->getLabelUnselected(); + mBtnBack->setLabel(LLStringUtil::null); // handled at appearance panel level? //mBtnBack->setClickedCallback(boost::bind(&LLPanelEditWearable::onBackButtonClicked, this)); @@ -1016,6 +1043,7 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show) if (show) { mPanelTitle->setText(title); + mPanelTitle->setToolTip(title); mDescTitle->setText(description_title); // set name @@ -1357,6 +1385,28 @@ void LLPanelEditWearable::updateVerbs() gSavedSettings.setU32("AvatarSex", (gAgentAvatarp->getSex() == SEX_MALE) ); } + // update back button and title according to dirty state. + static BOOL was_dirty = FALSE; + if (was_dirty != is_dirty) // to avoid redundant changes because this method is called from draw + { + static S32 label_width = mBtnBack->getFont()->getWidth(mBackBtnLabel); + const std::string& label = is_dirty ? mBackBtnLabel : LLStringUtil::null; + const S32 delta_width = is_dirty ? label_width : -label_width; + + mBtnBack->setLabel(label); + + // update rect according to label width + LLRect rect = mBtnBack->getRect(); + rect.mRight += delta_width; + mBtnBack->setShape(rect); + + // update title rect according to back button width + rect = mPanelTitle->getRect(); + rect.mLeft += delta_width; + mPanelTitle->setShape(rect); + + was_dirty = is_dirty; + } } void LLPanelEditWearable::configureAlphaCheckbox(LLVOAvatarDefines::ETextureIndex te, const std::string& name) diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 61441435cd..bfce2ae56e 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -120,6 +120,7 @@ private: // these are constant no matter what wearable we're editing LLButton *mBtnRevert; LLButton *mBtnBack; + std::string mBackBtnLabel; LLTextBox *mPanelTitle; LLTextBox *mDescTitle; diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index cf632c085f..043077db13 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -68,9 +68,9 @@ with the same filename but different name - - - + + + 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 fc1caca9e9..484617df34 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -131,19 +131,25 @@ name="tattoo_desc_text"> Tattoo: -