summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationview.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-05-08 00:09:53 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-05-08 00:09:53 +0300
commitaefb0503aa199c6dfd383fe7b23cd129960dc1be (patch)
treeb47e51ddb4d20799897377345334bb3f925ac4d6 /indra/newview/llconversationview.cpp
parent964afabae667c55ccb2d7051e6a6793773b025e0 (diff)
parent34322f8f37380df868703051230f2a4109602b3f (diff)
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llconversationview.cpp')
-rw-r--r--indra/newview/llconversationview.cpp82
1 files changed, 55 insertions, 27 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 15a8aacd37..0075b62100 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -234,6 +234,8 @@ void LLConversationViewSession::draw()
// Draw children if root folder, or any other folder that is open. Do not draw children when animating to closed state or you get rendering overlap.
bool draw_children = getRoot() == static_cast<LLFolderViewFolder*>(this) || isOpen();
+ // Todo/fix this: arrange hides children 'out of bonds', session 'slowly' adjusts container size, unhides children
+ // this process repeats until children fit
for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();)
{
@@ -254,9 +256,6 @@ void LLConversationViewSession::draw()
updateLabelRotation();
drawOpenFolderArrow(default_params, sFgColor);
}
-
- refresh();
-
LLView::draw();
}
@@ -441,28 +440,23 @@ void LLConversationViewSession::refresh()
LLSpeakingIndicatorManager::updateSpeakingIndicators();
// we should show indicator for specified voice session only if this is current channel. EXT-5562.
- if (!mIsInActiveVoiceChannel)
+ if (mSpeakingIndicator)
{
- if (mSpeakingIndicator)
- {
- mSpeakingIndicator->setVisible(false);
- }
- LLConversationViewParticipant* participant = NULL;
- items_t::const_iterator iter;
- for (iter = getItemsBegin(); iter != getItemsEnd(); iter++)
+ mSpeakingIndicator->setIsActiveChannel(mIsInActiveVoiceChannel);
+ mSpeakingIndicator->setShowParticipantsSpeaking(mIsInActiveVoiceChannel);
+ }
+
+ LLConversationViewParticipant* participant = NULL;
+ items_t::const_iterator iter;
+ for (iter = getItemsBegin(); iter != getItemsEnd(); iter++)
+ {
+ participant = dynamic_cast<LLConversationViewParticipant*>(*iter);
+ if (participant)
{
- participant = dynamic_cast<LLConversationViewParticipant*>(*iter);
- if (participant)
- {
- participant->hideSpeakingIndicator();
- }
+ participant->allowSpeakingIndicator(mIsInActiveVoiceChannel);
}
}
-
- if (mSpeakingIndicator)
- {
- mSpeakingIndicator->setShowParticipantsSpeaking(mIsInActiveVoiceChannel);
- }
+
requestArrange();
// Do the regular upstream refresh
LLFolderViewFolder::refresh();
@@ -474,8 +468,13 @@ void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& sessi
if (vmi)
{
+ bool old_value = mIsInActiveVoiceChannel;
mIsInActiveVoiceChannel = vmi->getUUID() == session_id;
mCallIconLayoutPanel->setVisible(mIsInActiveVoiceChannel);
+ if (old_value != mIsInActiveVoiceChannel)
+ {
+ refresh();
+ }
}
}
@@ -568,6 +567,7 @@ void LLConversationViewParticipant::draw()
F32 text_left = (F32)getLabelXPos();
LLColor4 color;
+
LLLocalSpeakerMgr *speakerMgr = LLLocalSpeakerMgr::getInstance();
if (speakerMgr && speakerMgr->isSpeakerToBeRemoved(mUUID))
@@ -579,9 +579,14 @@ void LLConversationViewParticipant::draw()
color = mIsSelected ? sHighlightFgColor : sFgColor;
}
+ LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(getViewModelItem());
+ if (participant_model)
+ {
+ mSpeakingIndicator->setIsModeratorMuted(participant_model->isModeratorMuted());
+ }
+
drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
drawLabel(font, text_left, y, color, right_x);
- refresh();
LLView::draw();
}
@@ -605,16 +610,39 @@ S32 LLConversationViewParticipant::arrange(S32* width, S32* height)
return arranged;
}
+// virtual
+void LLConversationViewParticipant::refresh()
+{
+ // Refresh the participant view from its model data
+ LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(getViewModelItem());
+ participant_model->resetRefresh();
+
+ // *TODO: We should also do something with vmi->isModerator() to echo that state in the UI somewhat
+ mSpeakingIndicator->setIsModeratorMuted(participant_model->isModeratorMuted());
+
+ // Do the regular upstream refresh
+ LLFolderViewItem::refresh();
+}
+
void LLConversationViewParticipant::addToFolder(LLFolderViewFolder* folder)
{
// Add the item to the folder (conversation)
LLFolderViewItem::addToFolder(folder);
// Retrieve the folder (conversation) UUID, which is also the speaker session UUID
- LLConversationItem* vmi = getParentFolder() ? dynamic_cast<LLConversationItem*>(getParentFolder()->getViewModelItem()) : NULL;
- if (vmi)
+ LLFolderViewFolder *prnt = getParentFolder();
+ if (prnt)
{
- addToSession(vmi->getUUID());
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(prnt->getViewModelItem());
+ if (vmi)
+ {
+ addToSession(vmi->getUUID());
+ }
+ LLConversationViewSession* session = dynamic_cast<LLConversationViewSession*>(prnt);
+ if (session)
+ {
+ allowSpeakingIndicator(session->isInActiveVoiceChannel());
+ }
}
}
@@ -744,9 +772,9 @@ LLView* LLConversationViewParticipant::getItemChildView(EAvatarListItemChildInde
return child_view;
}
-void LLConversationViewParticipant::hideSpeakingIndicator()
+void LLConversationViewParticipant::allowSpeakingIndicator(bool val)
{
- mSpeakingIndicator->setVisible(false);
+ mSpeakingIndicator->setIsActiveChannel(val);
}
// EOF