summaryrefslogtreecommitdiff
path: root/indra/newview/llcallfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r--indra/newview/llcallfloater.cpp124
1 files changed, 1 insertions, 123 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index e36dee4d91..f346a4b8c2 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -51,7 +51,6 @@
#include "lltransientfloatermgr.h"
#include "llviewerwindow.h"
#include "llvoicechannel.h"
-#include "lllayoutstack.h"
static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids);
void reshape_floater(LLCallFloater* floater, S32 delta_height);
@@ -226,16 +225,6 @@ void LLCallFloater::onChange()
}
}
-S32 LLCallFloater::notifyParent(const LLSD& info)
-{
- if("size_changes" == info["action"])
- {
- reshapeToFitContent();
- return 1;
- }
- return LLDockableFloater::notifyParent(info);
-}
-
//////////////////////////////////////////////////////////////////////////
/// PRIVATE SECTION
//////////////////////////////////////////////////////////////////////////
@@ -316,32 +305,7 @@ void LLCallFloater::updateSession()
//hide "Leave Call" button for nearby chat
bool is_local_chat = mVoiceType == VC_LOCAL_CHAT;
-
- LLPanel* leave_panel = findChild<LLPanel>("leave_call_btn_panel");
- if (leave_panel)
- {
- S32 delta = 0;
- bool visible = !is_local_chat;
- if ((bool)leave_panel->getVisible() != visible)
- {
- delta = visible
- ? leave_panel->getRect().getHeight()
- : -leave_panel->getRect().getHeight();
- }
- leave_panel->setVisible(visible);
- if (delta)
- {
- LLLayoutStack* stack = getChild<LLLayoutStack>("my_call_stack");
- BOOL animate = stack->getAnimate();
- // Disable animation to prevent layout updating in several frames.
- // We need this to get work reshapeToFitContent properly, otherwise
- // the height of leave_call_btn_panel won't be completely included.
- stack->setAnimate(FALSE);
- reshape_floater(this, delta);
- // Restore animate state.
- stack->setAnimate(animate);
- }
- }
+ childSetVisible("leave_call_btn_panel", !is_local_chat);
refreshParticipantList();
updateAgentModeratorState();
@@ -824,90 +788,4 @@ void LLCallFloater::reset()
mSpeakerManager = NULL;
}
-void reshape_floater(LLCallFloater* floater, S32 delta_height)
-{
- // Try to update floater top side if it is docked(to bottom bar).
- // Try to update floater bottom side or top side if it is un-docked.
- // If world rect is too small, floater will not be reshaped at all.
-
- LLRect floater_rect = floater->getRect();
- LLRect world_rect = gViewerWindow->getWorldViewRectScaled();
-
- // floater is docked to bottom bar
- if(floater->isDocked())
- {
- // can update floater top side
- if(floater_rect.mTop + delta_height < world_rect.mTop)
- {
- floater_rect.set(floater_rect.mLeft, floater_rect.mTop + delta_height,
- floater_rect.mRight, floater_rect.mBottom);
- }
- }
- // floater is un-docked
- else
- {
- // can update floater bottom side
- if( floater_rect.mBottom - delta_height >= world_rect.mBottom )
- {
- floater_rect.set(floater_rect.mLeft, floater_rect.mTop,
- floater_rect.mRight, floater_rect.mBottom - delta_height);
- }
- // could not update floater bottom side, check if we can update floater top side
- else if( floater_rect.mTop + delta_height < world_rect.mTop )
- {
- floater_rect.set(floater_rect.mLeft, floater_rect.mTop + delta_height,
- floater_rect.mRight, floater_rect.mBottom);
- }
- }
-
- floater->setShape(floater_rect);
- floater->getChild<LLLayoutStack>("my_call_stack")->updateLayout(FALSE);
-}
-
-void LLCallFloater::reshapeToFitContent()
-{
- const S32 ITEM_HEIGHT = getParticipantItemHeight();
- static const S32 MAX_VISIBLE_ITEMS = getMaxVisibleItems();
-
- static S32 items_pad = mAvatarList->getItemsPad();
- S32 list_height = mAvatarList->getRect().getHeight();
- S32 items_height = mAvatarList->getItemsRect().getHeight();
- if(items_height <= 0)
- {
- // make "no one near" text visible
- items_height = ITEM_HEIGHT + items_pad;
- }
- S32 max_list_height = MAX_VISIBLE_ITEMS * ITEM_HEIGHT + items_pad * (MAX_VISIBLE_ITEMS - 1);
- max_list_height += 2* mAvatarList->getBorderWidth();
-
- S32 delta = items_height - list_height;
- // too many items, don't reshape floater anymore, let scroll bar appear.
- if(items_height > max_list_height)
- {
- delta = max_list_height - list_height;
- }
-
- reshape_floater(this, delta);
-}
-
-S32 LLCallFloater::getParticipantItemHeight()
-{
- std::vector<LLPanel*> items;
- mAvatarList->getItems(items);
- if(items.size() > 0)
- {
- return items[0]->getRect().getHeight();
- }
- else
- {
- return getChild<LLPanel>("non_avatar_caller")->getRect().getHeight();
- }
-}
-
-S32 LLCallFloater::getMaxVisibleItems()
-{
- static LLCachedControl<S32> max_visible_items(*LLUI::sSettingGroups["config"],"CallFloaterMaxItems");
- return max_visible_items;
-}
-
//EOF