summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llbutton.cpp22
-rw-r--r--indra/llui/llbutton.h20
-rw-r--r--indra/llui/lltabcontainer.cpp75
-rw-r--r--indra/llui/lltabcontainer.h1
-rw-r--r--indra/newview/app_settings/settings.xml44
-rw-r--r--indra/newview/llgroupmgr.cpp38
-rw-r--r--indra/newview/llgroupmgr.h15
-rw-r--r--indra/newview/llimfloatercontainer.cpp46
-rw-r--r--indra/newview/llimfloatercontainer.h7
-rw-r--r--indra/newview/llimview.cpp8
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp9
-rw-r--r--indra/newview/llpanelpeoplemenus.h2
-rw-r--r--indra/newview/llparticipantlist.cpp6
-rw-r--r--indra/newview/skins/default/xui/en/menu_participant_list.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/button.xml4
15 files changed, 217 insertions, 83 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 9ce8ce8d55..4944ed4fe7 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -81,6 +81,10 @@ LLButton::Params::Params()
image_pressed_selected("image_pressed_selected"),
image_overlay("image_overlay"),
image_overlay_alignment("image_overlay_alignment", std::string("center")),
+ image_left_pad("image_left_pad"),
+ image_right_pad("image_right_pad"),
+ image_top_pad("image_top_pad"),
+ image_bottom_pad("image_bottom_pad"),
label_color("label_color"),
label_color_selected("label_color_selected"), // requires is_toggle true
label_color_disabled("label_color_disabled"),
@@ -140,6 +144,10 @@ LLButton::LLButton(const LLButton::Params& p)
mImageOverlay(p.image_overlay()),
mImageOverlayColor(p.image_overlay_color()),
mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)),
+ mImageOverlayLeftPad(p.image_left_pad),
+ mImageOverlayRightPad(p.image_right_pad),
+ mImageOverlayTopPad(p.image_top_pad),
+ mImageOverlayBottomPad(p.image_bottom_pad),
mIsToggle(p.is_toggle),
mScaleImage(p.scale_image),
mDropShadowedText(p.label_shadow),
@@ -763,6 +771,12 @@ void LLButton::draw()
center_x++;
}
+ S32 text_width_delta = overlay_width + 1;
+ // if image paddings set, they should participate in scaling process
+ S32 image_size_delta = mImageOverlayTopPad + mImageOverlayBottomPad;
+ overlay_width = overlay_width - image_size_delta;
+ overlay_height = overlay_height - image_size_delta;
+
// fade out overlay images on disabled buttons
LLColor4 overlay_color = mImageOverlayColor.get();
if (!enabled)
@@ -774,8 +788,8 @@ void LLButton::draw()
switch(mImageOverlayAlignment)
{
case LLFontGL::LEFT:
- text_left += overlay_width + 1;
- text_width -= overlay_width + 1;
+ text_left += overlay_width + mImageOverlayRightPad + 1;
+ text_width -= text_width_delta;
mImageOverlay->draw(
mLeftHPad,
center_y - (overlay_height / 2),
@@ -792,8 +806,8 @@ void LLButton::draw()
overlay_color);
break;
case LLFontGL::RIGHT:
- text_right -= overlay_width + 1;
- text_width -= overlay_width + 1;
+ text_right -= overlay_width + mImageOverlayLeftPad+ 1;
+ text_width -= text_width_delta;
mImageOverlay->draw(
getRect().getWidth() - mRightHPad - overlay_width,
center_y - (overlay_height / 2),
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index cd149e3113..8e5f19602f 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -106,6 +106,12 @@ public:
Optional<S32> pad_left;
Optional<S32> pad_bottom; // under text label
+ //image overlay paddings
+ Optional<S32> image_left_pad;
+ Optional<S32> image_right_pad;
+ Optional<S32> image_top_pad;
+ Optional<S32> image_bottom_pad;
+
// callbacks
Optional<CommitCallbackParam> click_callback, // alias -> commit_callback
mouse_down_callback,
@@ -186,6 +192,15 @@ public:
void setLeftHPad( S32 pad ) { mLeftHPad = pad; }
void setRightHPad( S32 pad ) { mRightHPad = pad; }
+ void setImageOverlayLeftPad( S32 pad ) { mImageOverlayLeftPad = pad; }
+ S32 getImageOverlayLeftPad() const { return mImageOverlayLeftPad; }
+ void setImageOverlayRightPad( S32 pad ) { mImageOverlayRightPad = pad; }
+ S32 getImageOverlayRightPad() const { return mImageOverlayRightPad; }
+ void setImageOverlayTopPad( S32 pad ) { mImageOverlayTopPad = pad; }
+ S32 getImageOverlayTopPad() const { return mImageOverlayTopPad; }
+ void setImageOverlayBottomPad( S32 pad ) { mImageOverlayBottomPad = pad; }
+ S32 getImageOverlayBottomPad() const { return mImageOverlayBottomPad; }
+
const std::string getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); }
const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); }
@@ -313,6 +328,11 @@ private:
S32 mRightHPad;
S32 mBottomVPad; // under text label
+ S32 mImageOverlayLeftPad;
+ S32 mImageOverlayRightPad;
+ S32 mImageOverlayTopPad;
+ S32 mImageOverlayBottomPad;
+
F32 mHoverGlowStrength;
F32 mCurGlowStrength;
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 43c44f2253..dcb3542e18 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1373,6 +1373,8 @@ BOOL LLTabContainer::setTab(S32 which)
{
LLTabTuple* tuple = *iter;
BOOL is_selected = ( tuple == selected_tuple );
+ tuple->mButton->setUseEllipses(TRUE);
+ tuple->mButton->setHAlign(LLFontGL::LEFT);
tuple->mTabPanel->setVisible( is_selected );
// tuple->mTabPanel->setFocus(is_selected); // not clear that we want to do this here.
tuple->mButton->setToggleState( is_selected );
@@ -1478,63 +1480,54 @@ void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state )
void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const LLColor4& color)
{
- static LLUICachedControl<S32> tab_padding ("UITabPadding", 0);
LLTabTuple* tuple = getTabByPanel(child);
if( tuple )
{
- tuple->mButton->setImageOverlay(image_name, LLFontGL::RIGHT, color);
-
- if (!mIsVertical)
- {
- // remove current width from total tab strip width
- mTotalTabWidth -= tuple->mButton->getRect().getWidth();
-
- S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ?
- tuple->mButton->getImageOverlay()->getImage()->getWidth(0) :
- 0;
-
- tuple->mPadding = image_overlay_width;
-
- tuple->mButton->setRightHPad(6);
- tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth),
- tuple->mButton->getRect().getHeight());
- // add back in button width to total tab strip width
- mTotalTabWidth += tuple->mButton->getRect().getWidth();
-
- // tabs have changed size, might need to scroll to see current tab
- updateMaxScrollPos();
- }
+ tuple->mButton->setImageOverlay(image_name, LLFontGL::LEFT, color);
+ reshape_tuple(tuple);
}
}
void LLTabContainer::setTabImage(LLPanel* child, const LLUUID& image_id, const LLColor4& color)
{
- static LLUICachedControl<S32> tab_padding ("UITabPadding", 0);
LLTabTuple* tuple = getTabByPanel(child);
if( tuple )
{
- tuple->mButton->setImageOverlay(image_id, LLFontGL::RIGHT, color);
+ tuple->mButton->setImageOverlay(image_id, LLFontGL::LEFT, color);
+ reshape_tuple(tuple);
+ }
+}
- if (!mIsVertical)
- {
- // remove current width from total tab strip width
- mTotalTabWidth -= tuple->mButton->getRect().getWidth();
+void LLTabContainer::reshape_tuple(LLTabTuple* tuple)
+{
+ static LLUICachedControl<S32> tab_padding ("UITabPadding", 0);
+ static LLUICachedControl<S32> image_left_padding ("UIButtonImageLeftPadding", 4);
+ static LLUICachedControl<S32> image_right_padding ("UIButtonImageRightPadding", 4);
+ static LLUICachedControl<S32> image_top_padding ("UIButtonImageTopPadding", 2);
+ static LLUICachedControl<S32> image_bottom_padding ("UIButtonImageBottomPadding", 2);
- S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ?
- tuple->mButton->getImageOverlay()->getImage()->getWidth(0) :
- 0;
+ if (!mIsVertical)
+ {
+ tuple->mButton->setImageOverlayLeftPad(image_left_padding);
+ tuple->mButton->setImageOverlayRightPad(image_right_padding);
+ tuple->mButton->setImageOverlayTopPad(image_top_padding);
+ tuple->mButton->setImageOverlayBottomPad(image_bottom_padding);
- tuple->mPadding = image_overlay_width;
+ // remove current width from total tab strip width
+ mTotalTabWidth -= tuple->mButton->getRect().getWidth();
- tuple->mButton->setRightHPad(6);
- tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth),
- tuple->mButton->getRect().getHeight());
- // add back in button width to total tab strip width
- mTotalTabWidth += tuple->mButton->getRect().getWidth();
+ S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ?
+ tuple->mButton->getImageOverlay()->getImage()->getWidth(0) : 0;
- // tabs have changed size, might need to scroll to see current tab
- updateMaxScrollPos();
- }
+ tuple->mPadding = image_overlay_width;
+
+ tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth),
+ tuple->mButton->getRect().getHeight());
+ // add back in button width to total tab strip width
+ mTotalTabWidth += tuple->mButton->getRect().getWidth();
+
+ // tabs have changed size, might need to scroll to see current tab
+ updateMaxScrollPos();
}
}
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index 33c49e0d6f..2a55877d3c 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -228,6 +228,7 @@ private:
// updates tab button images given the tuple, tab position and the corresponding params
void update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos);
+ void reshape_tuple(LLTabTuple* tuple);
// Variables
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 093e4f4894..1ef79aeec0 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9916,6 +9916,50 @@
<key>Value</key>
<integer>15</integer>
</map>
+ <key>UIButtonImageLeftPadding</key>
+ <map>
+ <key>Comment</key>
+ <string>Button Overlay Image Left Padding</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>4</integer>
+ </map>
+ <key>UIButtonImageRightPadding</key>
+ <map>
+ <key>Comment</key>
+ <string>Button Overlay Image Right Padding</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>4</integer>
+ </map>
+ <key>UIButtonImageTopPadding</key>
+ <map>
+ <key>Comment</key>
+ <string>Button Overlay Image Top Padding</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>2</integer>
+ </map>
+ <key>UIButtonImageBottomPadding</key>
+ <map>
+ <key>Comment</key>
+ <string>Button Overlay Image Bottom Padding</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>2</integer>
+ </map>
<key>UploadBakedTexOld</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp
index af58e81ca4..8bd0e520c3 100644
--- a/indra/newview/llgroupmgr.cpp
+++ b/indra/newview/llgroupmgr.cpp
@@ -762,6 +762,14 @@ void LLGroupMgr::addObserver(LLGroupMgrObserver* observer)
mObservers.insert(std::pair<LLUUID, LLGroupMgrObserver*>(observer->getID(), observer));
}
+void LLGroupMgr::addObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer)
+{
+ if(group_id.notNull() && observer)
+ {
+ mParticularObservers[group_id].insert(observer);
+ }
+}
+
void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer)
{
if (!observer)
@@ -784,6 +792,23 @@ void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer)
}
}
+void LLGroupMgr::removeObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer)
+{
+ if(group_id.isNull() || !observer)
+ {
+ return;
+ }
+
+ observer_map_t::iterator obs_it = mParticularObservers.find(group_id);
+ if(obs_it == mParticularObservers.end())
+ return;
+
+ obs_it->second.erase(observer);
+
+ if (obs_it->second.size() == 0)
+ mParticularObservers.erase(obs_it);
+}
+
LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id)
{
group_map_t::iterator gi = mGroups.find(id);
@@ -1325,6 +1350,7 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc)
LLUUID group_id = gi->first;
if (gi->second->mChanged)
{
+ // notify LLGroupMgrObserver
// Copy the map because observers may remove themselves on update
observer_multimap_t observers = mObservers;
@@ -1336,6 +1362,18 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc)
oi->second->changed(gc);
}
gi->second->mChanged = FALSE;
+
+
+ // notify LLParticularGroupMgrObserver
+ observer_map_t::iterator obs_it = mParticularObservers.find(group_id);
+ if(obs_it == mParticularObservers.end())
+ return;
+
+ observer_set_t& obs = obs_it->second;
+ for (observer_set_t::iterator ob_it = obs.begin(); ob_it != obs.end(); ++ob_it)
+ {
+ (*ob_it)->changed(group_id, gc);
+ }
}
}
}
diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h
index 487fdd4c5b..588b4a9034 100644
--- a/indra/newview/llgroupmgr.h
+++ b/indra/newview/llgroupmgr.h
@@ -53,6 +53,13 @@ protected:
LLUUID mID;
};
+class LLParticularGroupMgrObserver
+{
+public:
+ virtual ~LLParticularGroupMgrObserver(){}
+ virtual void changed(const LLUUID& group_id, LLGroupChange gc) = 0;
+};
+
class LLGroupRoleData;
class LLGroupMemberData
@@ -306,7 +313,9 @@ public:
~LLGroupMgr();
void addObserver(LLGroupMgrObserver* observer);
+ void addObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer);
void removeObserver(LLGroupMgrObserver* observer);
+ void removeObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer);
LLGroupMgrGroupData* getGroupData(const LLUUID& id);
void sendGroupPropertiesRequest(const LLUUID& group_id);
@@ -355,13 +364,19 @@ public:
private:
void notifyObservers(LLGroupChange gc);
+ void notifyObserver(const LLUUID& group_id, LLGroupChange gc);
void addGroup(LLGroupMgrGroupData* group_datap);
LLGroupMgrGroupData* createGroupData(const LLUUID &id);
typedef std::multimap<LLUUID,LLGroupMgrObserver*> observer_multimap_t;
observer_multimap_t mObservers;
+
typedef std::map<LLUUID, LLGroupMgrGroupData*> group_map_t;
group_map_t mGroups;
+
+ typedef std::set<LLParticularGroupMgrObserver*> observer_set_t;
+ typedef std::map<LLUUID,observer_set_t> observer_map_t;
+ observer_map_t mParticularObservers;
};
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 06a7b4a29c..784c2eaaf9 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -48,10 +48,7 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
mAutoResize = FALSE;
}
-LLIMFloaterContainer::~LLIMFloaterContainer()
-{
- LLGroupMgr::getInstance()->removeObserver(this);
-}
+LLIMFloaterContainer::~LLIMFloaterContainer(){}
BOOL LLIMFloaterContainer::postBuild()
{
@@ -95,11 +92,10 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
if(gAgent.isInGroup(session_id))
{
mSessions[session_id] = floaterp;
- mID = session_id;
- mGroupID.push_back(session_id);
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(session_id);
LLGroupMgr* gm = LLGroupMgr::getInstance();
- gm->addObserver(this);
+ gm->addObserver(session_id, this);
+ floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
if (group_data && group_data->mInsigniaID.notNull())
{
@@ -107,6 +103,7 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
}
else
{
+ mTabContainer->setTabImage(floaterp, "Generic_Group");
gm->sendGroupPropertiesRequest(session_id);
}
}
@@ -119,13 +116,14 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
mSessions[avatar_id] = floaterp;
LLUUID* icon_id_ptr = LLAvatarIconIDCache::getInstance()->get(avatar_id);
- if(!icon_id_ptr)
+ if(icon_id_ptr && icon_id_ptr->notNull())
{
- app.sendAvatarPropertiesRequest(avatar_id);
+ mTabContainer->setTabImage(floaterp, *icon_id_ptr);
}
else
{
- mTabContainer->setTabImage(floaterp, *icon_id_ptr);
+ mTabContainer->setTabImage(floaterp, "Generic_Person");
+ app.sendAvatarPropertiesRequest(avatar_id);
}
}
}
@@ -134,31 +132,28 @@ void LLIMFloaterContainer::processProperties(void* data, enum EAvatarProcessorTy
{
if (APT_PROPERTIES == type)
{
- LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data);
- if (avatar_data)
+ LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data);
+ if (avatar_data)
+ {
+ LLUUID avatar_id = avatar_data->avatar_id;
+ LLUUID* cached_avatarId = LLAvatarIconIDCache::getInstance()->get(avatar_id);
+ if(cached_avatarId && cached_avatarId->notNull() && avatar_data->image_id != *cached_avatarId)
{
- LLUUID avatar_id = avatar_data->avatar_id;
- if(avatar_data->image_id != *LLAvatarIconIDCache::getInstance()->get(avatar_id))
- {
- LLAvatarIconIDCache::getInstance()->add(avatar_id,avatar_data->image_id);
- }
+ LLAvatarIconIDCache::getInstance()->add(avatar_id,avatar_data->image_id);
mTabContainer->setTabImage(get_ptr_in_map(mSessions, avatar_id), avatar_data->image_id);
}
+ }
}
}
-void LLIMFloaterContainer::changed(LLGroupChange gc)
+void LLIMFloaterContainer::changed(const LLUUID& group_id, LLGroupChange gc)
{
if (GC_PROPERTIES == gc)
{
- for(groupIDs_t::iterator it = mGroupID.begin(); it!=mGroupID.end(); it++)
+ LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id);
+ if (group_data && group_data->mInsigniaID.notNull())
{
- LLUUID group_id = *it;
- LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id);
- if (group_data && group_data->mInsigniaID.notNull())
- {
- mTabContainer->setTabImage(get_ptr_in_map(mSessions, group_id), group_data->mInsigniaID);
- }
+ mTabContainer->setTabImage(get_ptr_in_map(mSessions, group_id), group_data->mInsigniaID);
}
}
}
@@ -166,6 +161,7 @@ void LLIMFloaterContainer::changed(LLGroupChange gc)
void LLIMFloaterContainer::onCloseFloater(LLUUID id)
{
LLAvatarPropertiesProcessor::instance().removeObserver(id, this);
+ LLGroupMgr::instance().removeObserver(id, this);
}
LLIMFloaterContainer* LLIMFloaterContainer::findInstance()
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index 1333b098bc..e4a32dbe1d 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -43,7 +43,7 @@
class LLTabContainer;
-class LLIMFloaterContainer : public LLMultiFloater, public LLAvatarPropertiesObserver, public LLGroupMgrObserver
+class LLIMFloaterContainer : public LLMultiFloater, public LLAvatarPropertiesObserver, public LLParticularGroupMgrObserver
{
public:
LLIMFloaterContainer(const LLSD& seed);
@@ -57,7 +57,7 @@ public:
LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
void processProperties(void* data, EAvatarProcessorType type);
- void changed(LLGroupChange gc);
+ void changed(const LLUUID& group_id, LLGroupChange gc);
static LLFloater* getCurrentVoiceFloater();
@@ -69,9 +69,6 @@ private:
typedef std::map<LLUUID,LLPanel*> avatarID_panel_map_t;
avatarID_panel_map_t mSessions;
- typedef std::vector<LLUUID> groupIDs_t;
- groupIDs_t mGroupID;
-
void onCloseFloater(LLUUID avatar_id);
};
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index f90a51c3f3..6ac7378c58 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -3239,7 +3239,13 @@ void LLCallInfoDialog::show(const std::string& status_name, const LLSD& args)
LLSD payload;
payload["msg"] = message;
- LLFloaterReg::showInstance("call_info", payload);
+ LLFloater* inst = LLFloaterReg::findInstance("call_info");
+
+ // avoid recreate instance with the same message
+ if (inst == NULL || message.getString() != inst->getChild<LLTextBox>("msg")->getValue())
+ {
+ LLFloaterReg::showInstance("call_info", payload);
+ }
}
LLHTTPRegistration<LLViewerChatterBoxSessionStartReply>
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index d9651a6045..501dac5dff 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -55,6 +55,15 @@ ContextMenu::ContextMenu()
{
}
+ContextMenu::~ContextMenu()
+{
+ // do not forget delete LLContextMenu* mMenu.
+ // It can have registered Enable callbacks which are called from the LLMenuHolderGL::draw()
+ // via selected item (menu_item_call) by calling LLMenuItemCallGL::buildDrawLabel.
+ // we can have a crash via using callbacks of deleted instance of ContextMenu. EXT-4725
+ if (mMenu) mMenu->die();
+}
+
void ContextMenu::show(LLView* spawning_view, const std::vector<LLUUID>& uuids, S32 x, S32 y)
{
if (mMenu)
diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h
index 14ae2985f0..7251f6dbbd 100644
--- a/indra/newview/llpanelpeoplemenus.h
+++ b/indra/newview/llpanelpeoplemenus.h
@@ -45,7 +45,7 @@ class ContextMenu : public LLAvatarListItem::ContextMenu
{
public:
ContextMenu();
- virtual ~ContextMenu() {}
+ virtual ~ContextMenu();
/**
* Show the menu at specified coordinates.
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index d54cbfe203..f83f3eba96 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -433,12 +433,6 @@ LLContextMenu* LLParticipantList::LLParticipantListMenu::createMenu()
LLContextMenu* main_menu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
"menu_participant_list.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
- // AD *TODO: This is workaround for EXT-4725- way to properly enable/disable "Call" menu item in
- // enableContextMenuItem() should be found.
- bool not_agent = mUUIDs.front() != gAgentID;
- bool can_call = not_agent && LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking();
- main_menu->setItemEnabled("Call", can_call);
-
// Don't show sort options for P2P chat
bool is_sort_visible = (mParent.mAvatarList && mParent.mAvatarList->size() > 1);
main_menu->setItemVisible("SortByName", is_sort_visible);
diff --git a/indra/newview/skins/default/xui/en/menu_participant_list.xml b/indra/newview/skins/default/xui/en/menu_participant_list.xml
index 04e02d0f6c..805ffbae66 100644
--- a/indra/newview/skins/default/xui/en/menu_participant_list.xml
+++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml
@@ -57,6 +57,9 @@
name="Call">
<menu_item_call.on_click
function="Avatar.Call" />
+ <menu_item_call.on_enable
+ function="ParticipantList.EnableItem"
+ parameter="can_call" />
</menu_item_call>
<menu_item_call
enabled="true"
diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml
index 51f85e65e2..74d8478551 100644
--- a/indra/newview/skins/default/xui/en/widgets/button.xml
+++ b/indra/newview/skins/default/xui/en/widgets/button.xml
@@ -7,6 +7,10 @@
image_selected="PushButton_Selected"
image_disabled_selected="PushButton_Selected_Disabled"
image_disabled="PushButton_Disabled"
+ image_left_pad="0"
+ image_right_pad="0"
+ image_top_pad="0"
+ image_bottom_pad="0"
label_color="ButtonLabelColor"
label_color_selected="ButtonLabelSelectedColor"
label_color_disabled="ButtonLabelDisabledColor"