From 8d80ba856df7f5bc657db28db15cc193bcb89c27 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 20 Jan 2010 21:27:02 +0200 Subject: Fixed normal bug EXT-4465 (UI issue with scroll-bar in Voice Control panel) --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 6317a6a392..49532aec12 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -54,6 +54,7 @@ #include "lllayoutstack.h" static void get_voice_participants_uuids(std::vector& speakers_uuids); +void reshape_floater(LLCallFloater* floater, S32 delta_height); class LLNonAvatarCaller : public LLAvatarListItem { @@ -315,8 +316,33 @@ void LLCallFloater::updateSession() //hide "Leave Call" button for nearby chat bool is_local_chat = mVoiceType == VC_LOCAL_CHAT; - childSetVisible("leave_call_btn_panel", !is_local_chat); - + + LLPanel* leave_panel = findChild("leave_call_btn_panel"); + if (leave_panel) + { + S32 delta = 0; + bool visible = !is_local_chat; + if (leave_panel->getVisible() != visible) + { + delta = visible + ? leave_panel->getRect().getHeight() + : -leave_panel->getRect().getHeight(); + } + leave_panel->setVisible(visible); + if (delta) + { + LLLayoutStack* stack = getChild("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); + } + } + refreshParticipantList(); updateAgentModeratorState(); -- cgit v1.2.3 From af85ca38d94e14dd63526acecfcc5bd4c764e205 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 20 Jan 2010 21:57:23 +0200 Subject: fixed windows build (comparing BOOL & bool) --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 49532aec12..e36dee4d91 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -322,7 +322,7 @@ void LLCallFloater::updateSession() { S32 delta = 0; bool visible = !is_local_chat; - if (leave_panel->getVisible() != visible) + if ((bool)leave_panel->getVisible() != visible) { delta = visible ? leave_panel->getRect().getHeight() -- cgit v1.2.3 From 9b1f9065f099ee3f1b66bd1ce9208c69ca3aea20 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 21 Jan 2010 13:04:45 +0200 Subject: Fixed normal bug EXT-4297 - Voice Control Panel resizing behavior. Also encreased floater minimum height to show one participant(this fixes ghost scrollbar) --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 76 ----------------------------------------- 1 file changed, 76 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index e36dee4d91..5c4a02f013 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -226,16 +226,6 @@ void LLCallFloater::onChange() } } -S32 LLCallFloater::notifyParent(const LLSD& info) -{ - if("size_changes" == info["action"]) - { - reshapeToFitContent(); - return 1; - } - return LLDockableFloater::notifyParent(info); -} - ////////////////////////////////////////////////////////////////////////// /// PRIVATE SECTION ////////////////////////////////////////////////////////////////////////// @@ -824,72 +814,6 @@ 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("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 items; -- cgit v1.2.3 From 30fbb126af61c72054b5794c0132c8223babb1f3 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 21 Jan 2010 13:52:05 +0200 Subject: Update for normal bug EXT-4297 - Voice Control Panel resizing behavior. Removed changes made in changeset 7982:97391caf89c3 (fixes EXT-4465(UI issue with scroll-bar in Voice Control panel)). It is not needed anymore because auto resizing was removed. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 48 +---------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 5c4a02f013..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& speakers_uuids); void reshape_floater(LLCallFloater* floater, S32 delta_height); @@ -306,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("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("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(); @@ -814,24 +788,4 @@ void LLCallFloater::reset() mSpeakerManager = NULL; } -S32 LLCallFloater::getParticipantItemHeight() -{ - std::vector items; - mAvatarList->getItems(items); - if(items.size() > 0) - { - return items[0]->getRect().getHeight(); - } - else - { - return getChild("non_avatar_caller")->getRect().getHeight(); - } -} - -S32 LLCallFloater::getMaxVisibleItems() -{ - static LLCachedControl max_visible_items(*LLUI::sSettingGroups["config"],"CallFloaterMaxItems"); - return max_visible_items; -} - //EOF -- cgit v1.2.3 From 0c80b1f7825643e247f151e038b2d3243421420a Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 22 Jan 2010 17:03:13 +0200 Subject: Related to normal task EXT-2214 Refactor IM Control Panels & EXT-3434 (There is no difference between invited and left participants in a Group call (Voice Controls)) -- replaced functionality to delayed removing of has left voice partcipants in VCP with one implemented in changeset f48e7cc41501 Behaviour of VCP implemented in EXT-3434 was not changed --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 69 +++++------------------------------------ 1 file changed, 8 insertions(+), 61 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index f346a4b8c2..d4c8adadc6 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -93,22 +93,6 @@ static void* create_non_avatar_caller(void*) return new LLNonAvatarCaller; } -LLCallFloater::LLAvatarListItemRemoveTimer::LLAvatarListItemRemoveTimer(callback_t remove_cb, F32 period, const LLUUID& speaker_id) -: LLEventTimer(period) -, mRemoveCallback(remove_cb) -, mSpeakerId(speaker_id) -{ -} - -BOOL LLCallFloater::LLAvatarListItemRemoveTimer::tick() -{ - if (mRemoveCallback) - { - mRemoveCallback(mSpeakerId); - } - return TRUE; -} - LLVoiceChannel* LLCallFloater::sCurrentVoiceCanel = NULL; LLCallFloater::LLCallFloater(const LLSD& key) @@ -122,10 +106,9 @@ LLCallFloater::LLCallFloater(const LLSD& key) , mSpeakingIndicator(NULL) , mIsModeratorMutedVoice(false) , mInitParticipantsVoiceState(false) -, mVoiceLeftRemoveDelay(10) { static LLUICachedControl voice_left_remove_delay ("VoiceParticipantLeftRemoveDelay", 10); - mVoiceLeftRemoveDelay = voice_left_remove_delay; + mSpeakerDelayRemover = new LLSpeakersDelayActionsStorage(boost::bind(&LLCallFloater::removeVoiceLeftParticipant, this, _1), voice_left_remove_delay); mFactoryMap["non_avatar_caller"] = LLCallbackMap(create_non_avatar_caller, NULL); LLVoiceClient::getInstance()->addObserver(this); @@ -135,6 +118,7 @@ LLCallFloater::LLCallFloater(const LLSD& key) LLCallFloater::~LLCallFloater() { resetVoiceRemoveTimers(); + delete mSpeakerDelayRemover; delete mParticipants; mParticipants = NULL; @@ -648,33 +632,11 @@ void LLCallFloater::setState(LLAvatarListItem* item, ESpeakerState state) void LLCallFloater::setVoiceRemoveTimer(const LLUUID& voice_speaker_id) { - - // If there is already a started timer for the current panel don't do anything. - bool no_timer_for_current_panel = true; - if (mVoiceLeftTimersMap.size() > 0) - { - timers_map::iterator found_it = mVoiceLeftTimersMap.find(voice_speaker_id); - if (found_it != mVoiceLeftTimersMap.end()) - { - no_timer_for_current_panel = false; - } - } - - if (no_timer_for_current_panel) - { - // Starting a timer to remove an avatar row panel after timeout - mVoiceLeftTimersMap.insert(timer_pair(voice_speaker_id, - new LLAvatarListItemRemoveTimer(boost::bind(&LLCallFloater::removeVoiceLeftParticipant, this, _1), mVoiceLeftRemoveDelay, voice_speaker_id))); - } + mSpeakerDelayRemover->setActionTimer(voice_speaker_id); } -void LLCallFloater::removeVoiceLeftParticipant(const LLUUID& voice_speaker_id) +bool LLCallFloater::removeVoiceLeftParticipant(const LLUUID& voice_speaker_id) { - if (mVoiceLeftTimersMap.size() > 0) - { - mVoiceLeftTimersMap.erase(mVoiceLeftTimersMap.find(voice_speaker_id)); - } - LLAvatarList::uuid_vector_t& speaker_uuids = mAvatarList->getIDs(); LLAvatarList::uuid_vector_t::iterator pos = std::find(speaker_uuids.begin(), speaker_uuids.end(), voice_speaker_id); if(pos != speaker_uuids.end()) @@ -682,34 +644,19 @@ void LLCallFloater::removeVoiceLeftParticipant(const LLUUID& voice_speaker_id) speaker_uuids.erase(pos); mAvatarList->setDirty(); } + + return false; } void LLCallFloater::resetVoiceRemoveTimers() { - if (mVoiceLeftTimersMap.size() > 0) - { - for (timers_map::iterator iter = mVoiceLeftTimersMap.begin(); - iter != mVoiceLeftTimersMap.end(); ++iter) - { - delete iter->second; - } - } - mVoiceLeftTimersMap.clear(); + mSpeakerDelayRemover->removeAllTimers(); } void LLCallFloater::removeVoiceRemoveTimer(const LLUUID& voice_speaker_id) { - // Remove the timer if it has been already started - if (mVoiceLeftTimersMap.size() > 0) - { - timers_map::iterator found_it = mVoiceLeftTimersMap.find(voice_speaker_id); - if (found_it != mVoiceLeftTimersMap.end()) - { - delete found_it->second; - mVoiceLeftTimersMap.erase(found_it); - } - } + mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id); } bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) -- cgit v1.2.3