summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-11-04 08:37:07 -0800
committerMerov Linden <merov@lindenlab.com>2012-11-04 08:37:07 -0800
commit749416fa7f9543c2b8a06e186b80c5e8ae354cb0 (patch)
treedec17ccc7b3618091e2dc98bd07334bec4201255 /indra
parent7c7cc56b037f05f148a7215d0c5f567989a0c012 (diff)
parent00da007acdae01eafdef8c1b74ad042228a4eacc (diff)
Merge viewer-hui-441
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lllayoutstack.cpp44
-rw-r--r--indra/newview/llimconversation.cpp60
-rw-r--r--indra/newview/llimfloater.cpp22
-rw-r--r--indra/newview/llimfloater.h3
4 files changed, 56 insertions, 73 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 1f2496a8e7..0674275612 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -36,7 +36,7 @@
#include "llcriticaldamp.h"
#include "boost/foreach.hpp"
-static const F32 MIN_FRACTIONAL_SIZE = 0.0f;
+static const F32 MIN_FRACTIONAL_SIZE = 0.00001f;
static const F32 MAX_FRACTIONAL_SIZE = 1.f;
static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
@@ -71,7 +71,7 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
mCollapseAmt(0.f),
mVisibleAmt(1.f), // default to fully visible
mResizeBar(NULL),
- mFractionalSize(MIN_FRACTIONAL_SIZE),
+ mFractionalSize(0.f),
mTargetDim(0),
mIgnoreReshape(false),
mOrientation(LLLayoutStack::HORIZONTAL)
@@ -521,7 +521,7 @@ void LLLayoutStack::updateFractionalSizes()
{
if (panelp->mAutoResize)
{
- total_resizable_dim += llmax(0, panelp->getLayoutDim() - panelp->getRelevantMinDim());
+ total_resizable_dim += llmax(MIN_FRACTIONAL_SIZE, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim()));
}
}
@@ -672,12 +672,12 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
S32 new_dim = (mOrientation == HORIZONTAL)
? new_rect.getWidth()
: new_rect.getHeight();
- S32 delta_dim = new_dim - resized_panel->getVisibleDim();
- if (delta_dim == 0) return;
+ S32 delta_panel_dim = new_dim - resized_panel->getVisibleDim();
+ if (delta_panel_dim == 0) return;
F32 total_visible_fraction = 0.f;
F32 delta_auto_resize_headroom = 0.f;
- F32 original_auto_resize_headroom = 0.f;
+ F32 old_auto_resize_headroom = 0.f;
LLLayoutPanel* other_resize_panel = NULL;
LLLayoutPanel* following_panel = NULL;
@@ -686,7 +686,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
{
if (panelp->mAutoResize)
{
- original_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
+ old_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
if (panelp->getVisible() && !panelp->mCollapsed)
{
total_visible_fraction += panelp->mFractionalSize;
@@ -704,25 +704,24 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
}
}
-
if (resized_panel->mAutoResize)
{
if (!other_resize_panel || !other_resize_panel->mAutoResize)
{
- delta_auto_resize_headroom += delta_dim;
+ delta_auto_resize_headroom += delta_panel_dim;
}
}
else
{
if (!other_resize_panel || other_resize_panel->mAutoResize)
{
- delta_auto_resize_headroom -= delta_dim;
+ delta_auto_resize_headroom -= delta_panel_dim;
}
}
F32 fraction_given_up = 0.f;
F32 fraction_remaining = 1.f;
- F32 updated_auto_resize_headroom = original_auto_resize_headroom + delta_auto_resize_headroom;
+ F32 new_auto_resize_headroom = old_auto_resize_headroom + delta_auto_resize_headroom;
enum
{
@@ -734,7 +733,14 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
{
- if (!panelp->getVisible() || panelp->mCollapsed) continue;
+ if (!panelp->getVisible() || panelp->mCollapsed)
+ {
+ if (panelp->mAutoResize)
+ {
+ fraction_remaining -= panelp->mFractionalSize;
+ }
+ continue;
+ }
if (panelp == resized_panel)
{
@@ -746,9 +752,9 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
case BEFORE_RESIZED_PANEL:
if (panelp->mAutoResize)
{ // freeze current size as fraction of overall auto_resize space
- F32 fractional_adjustment_factor = updated_auto_resize_headroom == 0.f
+ F32 fractional_adjustment_factor = new_auto_resize_headroom == 0.f
? 1.f
- : original_auto_resize_headroom / updated_auto_resize_headroom;
+ : old_auto_resize_headroom / new_auto_resize_headroom;
F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor,
MIN_FRACTIONAL_SIZE,
MAX_FRACTIONAL_SIZE);
@@ -765,9 +771,9 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
case RESIZED_PANEL:
if (panelp->mAutoResize)
{ // freeze new size as fraction
- F32 new_fractional_size = (updated_auto_resize_headroom == 0.f)
+ F32 new_fractional_size = (new_auto_resize_headroom == 0.f)
? MAX_FRACTIONAL_SIZE
- : llclamp(total_visible_fraction * (F32)(new_dim - (panelp->getRelevantMinDim() - 1)) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
+ : llclamp(total_visible_fraction * (F32)(new_dim - panelp->getRelevantMinDim()) / new_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
fraction_remaining -= panelp->mFractionalSize;
panelp->mFractionalSize = new_fractional_size;
@@ -791,7 +797,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
else
{
F32 new_fractional_size = llclamp(total_visible_fraction * (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom)
- / updated_auto_resize_headroom,
+ / new_auto_resize_headroom,
MIN_FRACTIONAL_SIZE,
MAX_FRACTIONAL_SIZE);
fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
@@ -800,7 +806,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
}
else
{
- panelp->mTargetDim -= delta_dim;
+ panelp->mTargetDim -= delta_panel_dim;
}
which_panel = AFTER_RESIZED_PANEL;
break;
@@ -816,7 +822,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
}
}
updateLayout();
- normalizeFractionalSizes();
+ //normalizeFractionalSizes();
}
void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent)
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index 920666ef90..de769d95ac 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -29,6 +29,8 @@
#include "llimconversation.h"
+#include "llagent.h"
+#include "llavataractions.h"
#include "llchatentry.h"
#include "llchathistory.h"
#include "llchiclet.h"
@@ -419,50 +421,47 @@ void LLIMConversation::updateConversationViewParticipant(const LLUUID& participa
if (widget)
{
widget->refresh();
- refreshConversation();
}
+ refreshConversation();
}
void LLIMConversation::refreshConversation()
{
- // Debug : Check that all participant models do have a view (debug consistency check)
- /*
- LLParticipantList* item = getParticipantList();
- llinfos << "Merov debug : Start consistency check" << llendl;
- LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = item->getChildrenBegin();
- LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = item->getChildrenEnd();
- while (current_participant_model != end_participant_model)
+ // Note: We collect participants names to change the session name only in the case of ad-hoc conversations
+ bool is_ad_hoc = (mSession ? mSession->isAdHocSessionType() : false);
+ uuid_vec_t participants_uuids; // uuids vector for building the added participants name string
+ // For P2P chat, we still need to update the session name who may have changed (switch display name for instance)
+ if (mIsP2PChat && mSession)
{
- LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(*current_participant_model);
- if (participant_model != NULL)
- {
- LLUUID uuid = participant_model->getUUID();
- LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,uuid);
- if (!widget)
- {
- llinfos << "Merov debug : Consistency error! Couldn't find widget for " << participant_model->getName() << llendl;
- }
- else
- {
- llinfos << "Merov debug : Consistency check pass for " << participant_model->getName() << llendl;
- }
- }
- else
- {
- llinfos << "Merov debug : Consistency check, skip non participant child" << llendl;
- }
- current_participant_model++;
+ participants_uuids.push_back(mSession->mOtherParticipantID);
}
- llinfos << "Merov debug : End consistency check" << llendl;
- */
-
+
conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin();
while (widget_it != mConversationsWidgets.end())
{
+ // Add the participant to the list except if it's the agent itself (redundant)
+ if (is_ad_hoc && (widget_it->first != gAgentID))
+ {
+ participants_uuids.push_back(widget_it->first);
+ }
widget_it->second->refresh();
widget_it->second->setVisible(TRUE);
++widget_it;
}
+ if (is_ad_hoc || mIsP2PChat)
+ {
+ // Build the session name and update it
+ std::string session_name;
+ if (participants_uuids.size() != 0)
+ {
+ LLAvatarActions::buildResidentsString(participants_uuids, session_name);
+ }
+ else
+ {
+ session_name = LLIMModel::instance().getName(mSessionID);
+ }
+ updateSessionName(session_name);
+ }
mConversationViewModel.requestSortAll();
mConversationsRoot->arrangeAll();
mConversationsRoot->update();
@@ -559,7 +558,6 @@ void LLIMConversation::hideOrShowTitle()
void LLIMConversation::updateSessionName(const std::string& name)
{
- llinfos << "Merov debug : updateSessionName, name = " << name << llendl;
mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + name);
}
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 607cdbd265..8742460689 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -270,14 +270,7 @@ void LLIMFloater::initIMFloater()
mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label"));
}
- if (mIsP2PChat)
- {
- // look up display name for window title
- LLAvatarNameCache::get(mSession->mOtherParticipantID,
- boost::bind(&LLIMFloater::onAvatarNameCache,
- this, _1, _2));
- }
- else
+ if (!mIsP2PChat)
{
std::string session_name(LLIMModel::instance().getName(mSessionID));
updateSessionName(session_name);
@@ -530,18 +523,7 @@ void LLIMFloater::updateSessionName(const std::string& name)
{
LLIMConversation::updateSessionName(name);
setTitle(name);
-}
-
-void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id,
- const LLAvatarName& av_name)
-{
- // Use display name for label
- updateSessionName(av_name.mDisplayName);
-
- // Overwrite the floater title with the extended name
- std::string ui_title = av_name.getCompleteName();
- setTitle(ui_title);
- mTypingStart.setArg("[NAME]", ui_title);
+ mTypingStart.setArg("[NAME]", name);
}
void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl)
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index 39210546fb..dba3a4bcbd 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -141,9 +141,6 @@ private:
// Update the window title and input field help text
/*virtual*/ void updateSessionName(const std::string& name);
- // For display name lookups for IM window titles
- void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
-
/// Updates the list of ad hoc conference participants
/// in an IM floater title.
void onParticipantsListChanged(LLUICtrl* ctrl);