From 4347af5763672d0b575ad255aa3565a51c0a632e Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 19 Mar 2010 17:03:32 +0200 Subject: Done normal task EXT-6267 ([TRUNCATION] [EN XUI REWORK] - Side panel, profiles: the teleport button is truncated. need 'en' xui designer rework) * moved Map Button into the dropdown menu (with enable/click logic). New is added into the menu_profile_overflow.xml * redesigned rest of buttons to accommodate available space Now buttons' widths are enough to not truncate labels in all locales. NOTE: New "Map" item menu should be localized (just move values from panel_profile.xml to menu_profile_overflow.xml) in other locales. Reviewed by Vadim at https://codereview.productengine.com/secondlife/r/59/ --HG-- branch : product-engine --- indra/newview/llpanelavatar.cpp | 11 ++++++++ indra/newview/llpanelavatar.h | 1 + .../skins/default/xui/en/menu_profile_overflow.xml | 9 +++++++ .../newview/skins/default/xui/en/panel_profile.xml | 30 ++++++---------------- 4 files changed, 29 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 57b478ffef..a0ba2f739b 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -495,6 +495,7 @@ BOOL LLPanelAvatarProfile::postBuild() &LLPanelAvatarProfile::onMapButtonClick, this)), NULL); LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("Profile.ShowOnMap", boost::bind(&LLPanelAvatarProfile::onMapButtonClick, this)); registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this)); registrar.add("Profile.Share", boost::bind(&LLPanelAvatarProfile::share, this)); registrar.add("Profile.BlockUnblock", boost::bind(&LLPanelAvatarProfile::toggleBlock, this)); @@ -504,6 +505,7 @@ BOOL LLPanelAvatarProfile::postBuild() registrar.add("Profile.CSR", boost::bind(&LLPanelAvatarProfile::csr, this)); LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable; + enable.add("Profile.EnableShowOnMap", boost::bind(&LLPanelAvatarProfile::enableShowOnMap, this)); enable.add("Profile.EnableGod", boost::bind(&enable_god)); enable.add("Profile.EnableBlock", boost::bind(&LLPanelAvatarProfile::enableBlock, this)); enable.add("Profile.EnableUnblock", boost::bind(&LLPanelAvatarProfile::enableUnblock, this)); @@ -698,6 +700,15 @@ void LLPanelAvatarProfile::toggleBlock() LLAvatarActions::toggleBlock(getAvatarId()); } +bool LLPanelAvatarProfile::enableShowOnMap() +{ + bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()); + + bool enable_map_btn = (is_buddy_online && is_agent_mappable(getAvatarId())) + || gAgent.isGodlike(); + return enable_map_btn; +} + bool LLPanelAvatarProfile::enableBlock() { return LLAvatarActions::canBlock(getAvatarId()) && !LLAvatarActions::isBlocked(getAvatarId()); diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 2bd23b6e9c..bb8df2ff9c 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -202,6 +202,7 @@ protected: void unfreeze(); void csr(); + bool enableShowOnMap(); bool enableBlock(); bool enableUnblock(); bool enableGod(); diff --git a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml index 5162a4902f..b0b7b554b0 100644 --- a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml +++ b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml @@ -5,6 +5,15 @@ mouse_opaque="false" name="profile_overflow_menu" width="120"> + + + + + width="117" />