summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-02-28 13:45:36 -0800
committerRichard Linden <none@none>2012-02-28 13:45:36 -0800
commit80f2548371328f6fa1936ecc03a85a09f1b19508 (patch)
treeb33d849e565b9ecdf0ea370378fb67c55c178a64 /indra
parent874a67776bb2e0ec3f0d5c79cae570830da91d56 (diff)
EXP-1918 FIX Floaters that are stacked are not offset
EXP-1919 FIX Resizing viewer window with minimized floaters can result in floaters appearing off screen when un-minimized
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llfloater.cpp44
-rw-r--r--indra/llui/llfloater.h2
2 files changed, 24 insertions, 22 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index b23230bdd4..f49b4edb98 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -850,7 +850,7 @@ void LLFloater::applyControlsAndPosition(LLFloater* other)
{
if (!applyRectControl())
{
- applyPositioning(other);
+ applyPositioning(other, true);
}
}
}
@@ -919,7 +919,7 @@ bool LLFloater::applyDockState()
return docked;
}
-void LLFloater::applyPositioning(LLFloater* other)
+void LLFloater::applyPositioning(LLFloater* other, bool on_open)
{
// Otherwise position according to the positioning code
switch (mPositioning)
@@ -934,29 +934,30 @@ void LLFloater::applyPositioning(LLFloater* other)
case LLFloaterEnums::POSITIONING_CASCADE_GROUP:
case LLFloaterEnums::POSITIONING_CASCADING:
- if (other != NULL && other != this)
+ if (on_open)
{
- stackWith(*other);
- }
- else
- {
- static const U32 CASCADING_FLOATER_HOFFSET = 0;
- static const U32 CASCADING_FLOATER_VOFFSET = 0;
+ if (other != NULL && other != this)
+ {
+ stackWith(*other);
+ }
+ else
+ {
+ static const U32 CASCADING_FLOATER_HOFFSET = 0;
+ static const U32 CASCADING_FLOATER_VOFFSET = 0;
- const LLRect& snap_rect = gFloaterView->getSnapRect();
+ const LLRect& snap_rect = gFloaterView->getSnapRect();
- const S32 horizontal_offset = CASCADING_FLOATER_HOFFSET;
- const S32 vertical_offset = snap_rect.getHeight() - CASCADING_FLOATER_VOFFSET;
+ const S32 horizontal_offset = CASCADING_FLOATER_HOFFSET;
+ const S32 vertical_offset = snap_rect.getHeight() - CASCADING_FLOATER_VOFFSET;
- S32 rect_height = getRect().getHeight();
- setOrigin(horizontal_offset, vertical_offset - rect_height);
+ S32 rect_height = getRect().getHeight();
+ setOrigin(horizontal_offset, vertical_offset - rect_height);
- translate(snap_rect.mLeft, snap_rect.mBottom);
- //translateIntoRect(snap_rect);
+ translate(snap_rect.mLeft, snap_rect.mBottom);
+ }
+ //mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
+ setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
}
- mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
- setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
-
break;
case LLFloaterEnums::POSITIONING_RELATIVE:
@@ -1262,6 +1263,7 @@ void LLFloater::setMinimized(BOOL minimize)
// Reshape *after* setting mMinimized
reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
+ applyPositioning(NULL, false);
}
make_ui_sound("UISndWindowClose");
@@ -2199,7 +2201,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
if (!floaterp->isMinimized() && floaterp->getCanDrag())
{
LLRect old_rect = floaterp->getRect();
- floaterp->applyPositioning(NULL);
+ floaterp->applyPositioning(NULL, false);
LLRect new_rect = floaterp->getRect();
//LLRect r = floaterp->getRect();
@@ -3284,7 +3286,7 @@ void LLFloater::stackWith(LLFloater& other)
setShape(next_rect);
- other.mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
+ //other.mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 4aa663d57e..64d6dcea04 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -358,7 +358,7 @@ protected:
virtual bool applyRectControl();
bool applyDockState();
- void applyPositioning(LLFloater* other);
+ void applyPositioning(LLFloater* other, bool on_open);
void applyRelativePosition();
void storeRectControl();