From 399de4f345eb0bf43e84bf0a65b3251798f59a13 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 24 Oct 2011 14:28:09 -0700 Subject: EXP-1454 FIX People floater 'cascades' as if opening a new window while looking at group profiles --- indra/llui/llfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 7100ea13a7..2c707afa8f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -935,7 +935,7 @@ void LLFloater::applyPositioning(LLFloater* other) case LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP: case LLFloaterEnums::OPEN_POSITIONING_CASCADING: - if (other != NULL) + if (other != NULL && other != this) { stackWith(*other); } -- cgit v1.2.3 From e356f5c0dce81aff113d562485721305d21ece77 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 24 Oct 2011 17:30:27 -0700 Subject: EXP-1456 FIX NEARBY CHAT window sometimes opens at the top of the screen. --- indra/llui/llfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 2c707afa8f..432397d3e9 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1070,7 +1070,7 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user) const LLRect old_rect = getRect(); LLView::handleReshape(new_rect, by_user); - if (by_user) + if (by_user && !isMinimized()) { storeRectControl(); mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE; -- cgit v1.2.3 From b6858df0dd9fa06ec8fa56c5ba63925a790b4811 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 8 Nov 2011 13:47:08 -0800 Subject: LLHandle is now implicitly convertable to LLHandle and LLHandle can be downcast to LLHandle using the LLHandleProvider mixin --- indra/llui/llfloater.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 432397d3e9..07d2e1ed5f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -111,7 +111,6 @@ LLFloater::click_callback LLFloater::sButtonCallbacks[BUTTON_COUNT] = LLMultiFloater* LLFloater::sHostp = NULL; BOOL LLFloater::sQuitting = FALSE; // Flag to prevent storing visibility controls while quitting -LLFloater::handle_map_t LLFloater::sFloaterMap; LLFloaterView* gFloaterView = NULL; @@ -268,7 +267,6 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mMinimizeSignal(NULL) // mNotificationContext(NULL) { - mHandle.bind(this); // mNotificationContext = new LLFloaterNotificationContext(getHandle()); // Clicks stop here. @@ -323,9 +321,6 @@ void LLFloater::initFloater(const Params& p) // Floaters are created in the invisible state setVisible(FALSE); - // add self to handle->floater map - sFloaterMap[mHandle] = this; - if (!getParent()) { gFloaterView->addChild(this); @@ -532,8 +527,6 @@ LLFloater::~LLFloater() // correct, non-minimized positions. setMinimized( FALSE ); - sFloaterMap.erase(mHandle); - delete mDragHandle; for (S32 i = 0; i < 4; i++) { @@ -1038,7 +1031,9 @@ BOOL LLFloater::canSnapTo(const LLView* other_view) if (other_view != getParent()) { const LLFloater* other_floaterp = dynamic_cast(other_view); - if (other_floaterp && other_floaterp->getSnapTarget() == getHandle() && mDependents.find(other_floaterp->getHandle()) != mDependents.end()) + if (other_floaterp + && other_floaterp->getSnapTarget() == getHandle() + && mDependents.find(other_floaterp->getHandle()) != mDependents.end()) { // this is a dependent that is already snapped to us, so don't snap back to it return FALSE; @@ -1677,18 +1672,17 @@ void LLFloater::onClickHelp( LLFloater* self ) LLFloater* LLFloater::getClosableFloaterFromFocus() { LLFloater* focused_floater = NULL; - - handle_map_iter_t iter; - for(iter = sFloaterMap.begin(); iter != sFloaterMap.end(); ++iter) + LLInstanceTracker::instance_iter it = beginInstances(); + LLInstanceTracker::instance_iter end_it = endInstances(); + for (; it != end_it; ++it) { - focused_floater = iter->second; - if (focused_floater->hasFocus()) + if (it->hasFocus()) { break; } } - if (iter == sFloaterMap.end()) + if (it == endInstances()) { // nothing found, return return NULL; -- cgit v1.2.3 From 98755a62bb414f23919e003101153c20d3ab3f72 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 14 Nov 2011 15:39:32 -0800 Subject: EXP-1588 WIP Floaters do not snap to edge --- indra/llui/llfloater.cpp | 66 +++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 35 deletions(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 432397d3e9..05bd7fb67f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -58,6 +58,8 @@ #include "llhelp.h" #include "llmultifloater.h" #include "llsdutil.h" +#include + // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; @@ -2163,8 +2165,15 @@ LLFloaterView::LLFloaterView (const Params& p) // By default, adjust vertical. void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) { - S32 old_width = getRect().getWidth(); - S32 old_height = getRect().getHeight(); + S32 old_right = mLastSnapRect.mRight; + S32 old_top = mLastSnapRect.mTop; + + LLView::reshape(width, height, called_from_parent); + + S32 new_right = getSnapRect().mRight; + S32 new_top = getSnapRect().mTop; + + mLastSnapRect = getSnapRect(); for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { @@ -2179,59 +2188,40 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) // Make if follow the edge it is closest to U32 follow_flags = 0x0; - if (floaterp->isMinimized()) - { - follow_flags |= (FOLLOWS_LEFT | FOLLOWS_TOP); - } - else + if (!floaterp->isMinimized()) { LLRect r = floaterp->getRect(); // Compute absolute distance from each edge of screen S32 left_offset = llabs(r.mLeft - 0); - S32 right_offset = llabs(old_width - r.mRight); + S32 right_offset = llabs(old_right - r.mRight); - S32 top_offset = llabs(old_height - r.mTop); + S32 top_offset = llabs(old_top - r.mTop); S32 bottom_offset = llabs(r.mBottom - 0); + S32 translate_x = 0; + S32 translate_y = 0; - if (left_offset < right_offset) - { - follow_flags |= FOLLOWS_LEFT; - } - else + if (left_offset > right_offset) { - follow_flags |= FOLLOWS_RIGHT; + translate_x = new_right - old_right; } - // "No vertical adjustment" usually means that the bottom of the view - // has been pushed up or down. Hence we want the floaters to follow - // the top. if (top_offset < bottom_offset) { - follow_flags |= FOLLOWS_TOP; - } - else - { - follow_flags |= FOLLOWS_BOTTOM; + translate_y = new_top - old_top; } - } - floaterp->setFollows(follow_flags); - - //RN: all dependent floaters copy follow behavior of "parent" - for(LLFloater::handle_set_iter_t dependent_it = floaterp->mDependents.begin(); - dependent_it != floaterp->mDependents.end(); ++dependent_it) - { - LLFloater* dependent_floaterp = dependent_it->get(); - if (dependent_floaterp) + floaterp->translate(translate_x, translate_y); + BOOST_FOREACH(LLHandle dependent_floater, floaterp->mDependents) { - dependent_floaterp->setFollows(follow_flags); + if (dependent_floater.get()) + { + dependent_floater.get()->translate(translate_x, translate_y); + } } } } - - LLView::reshape(width, height, called_from_parent); } @@ -2631,6 +2621,12 @@ void LLFloaterView::shiftFloaters(S32 x_offset, S32 y_offset) void LLFloaterView::refresh() { + LLRect snap_rect = getSnapRect(); + if (snap_rect != mLastSnapRect) + { + reshape(getRect().getWidth(), getRect().getHeight(), TRUE); + } + // Constrain children to be entirely on the screen for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { -- cgit v1.2.3 From 28db67c3952f65d9c3ee23ce85851ba8ab29fc50 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 14 Nov 2011 17:16:34 -0800 Subject: Removed unused variable to fix the mac build --- indra/llui/llfloater.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 05bd7fb67f..c5d7d1db56 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2185,9 +2185,6 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) continue; } - // Make if follow the edge it is closest to - U32 follow_flags = 0x0; - if (!floaterp->isMinimized()) { LLRect r = floaterp->getRect(); -- cgit v1.2.3 From 30beda590a93aca9b2a27edb9be94665290c2e7c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 15 Nov 2011 16:40:31 -0800 Subject: EXP-1588 FIX Floaters do not snap to edge made non-movable floaters not use auto-follow logic toasts will now use own layout logic --- indra/llui/llfloater.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c5d7d1db56..a5fd3ea552 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1951,6 +1951,12 @@ void LLFloater::setCanDrag(BOOL can_drag) } } +bool LLFloater::getCanDrag() +{ + return mDragHandle->getEnabled(); +} + + void LLFloater::updateTitleButtons() { static LLUICachedControl floater_close_box_size ("UIFloaterCloseBoxSize", 0); @@ -2181,7 +2187,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) LLFloater* floaterp = (LLFloater*)viewp; if (floaterp->isDependent()) { - // dependents use same follow flags as their "dependee" + // dependents are moved with their "dependee" continue; } @@ -2209,7 +2215,11 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) translate_y = new_top - old_top; } - floaterp->translate(translate_x, translate_y); + // don't reposition immovable floaters + if (floaterp->getCanDrag()) + { + floaterp->translate(translate_x, translate_y); + } BOOST_FOREACH(LLHandle dependent_floater, floaterp->mDependents) { if (dependent_floater.get()) -- cgit v1.2.3 From afc19140575fb96826b12139d77c5b2174c4713e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 7 Dec 2011 11:47:33 -0800 Subject: EXP-1652 FIX (Build tool floater size affected by viewer window size) force all floaters to have follows flags = FOLLOWS_NONE and use llfloaterview::reshape logic instead removed existing follows flags from any floater XUI and deprecated the follows parameter for floaters --- indra/llui/llfloater.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 40b550269c..33548151fd 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -195,7 +195,8 @@ LLFloater::Params::Params() dock_pressed_image("dock_pressed_image"), help_pressed_image("help_pressed_image"), open_callback("open_callback"), - close_callback("close_callback") + close_callback("close_callback"), + follows("follows") { changeDefault(visible, false); } @@ -2965,6 +2966,9 @@ void LLFloater::initFromParams(const LLFloater::Params& p) // control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible LLPanel::initFromParams(p); + // override any follows flags + setFollows(FOLLOWS_NONE); + mTitle = p.title; mShortTitle = p.short_title; applyTitle(); -- cgit v1.2.3