summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llfloater.cpp10
-rw-r--r--indra/llui/llfloater.h4
-rw-r--r--indra/llui/llview.cpp4
-rw-r--r--indra/llui/llview.h4
-rw-r--r--indra/newview/llbottomtray.cpp4
-rw-r--r--indra/newview/llsidetray.cpp11
-rw-r--r--indra/newview/llviewerwindow.cpp1
-rw-r--r--indra/newview/skins/default/xui/en/main_view.xml7
-rw-r--r--indra/newview/skins/minimal/xui/en/main_view.xml7
9 files changed, 29 insertions, 23 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index c425782715..35e0d9d890 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -2590,9 +2590,13 @@ void LLFloaterView::draw()
LLRect LLFloaterView::getSnapRect() const
{
- LLRect snap_rect = getRect();
- snap_rect.mBottom += mSnapOffsetBottom;
- snap_rect.mRight -= mSnapOffsetRight;
+ LLRect snap_rect = getLocalRect();
+
+ LLView* snap_view = mSnapView.get();
+ if (snap_view)
+ {
+ snap_view->localRectToOtherView(snap_view->getLocalRect(), &snap_rect, this);
+ }
return snap_rect;
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index bb96272d02..0e83b80c89 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -495,10 +495,10 @@ public:
// value is not defined.
S32 getZOrder(LLFloater* child);
- void setSnapOffsetBottom(S32 offset) { mSnapOffsetBottom = offset; }
- void setSnapOffsetRight(S32 offset) { mSnapOffsetRight = offset; }
+ void setFloaterSnapView(LLHandle<LLView> snap_view) {mSnapView = snap_view; }
private:
+ LLHandle<LLView> mSnapView;
BOOL mFocusCycleMode;
S32 mSnapOffsetBottom;
S32 mSnapOffsetRight;
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 267640a226..acf7953906 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1958,7 +1958,7 @@ void LLView::centerWithin(const LLRect& bounds)
translate( left - getRect().mLeft, bottom - getRect().mBottom );
}
-BOOL LLView::localPointToOtherView( S32 x, S32 y, S32 *other_x, S32 *other_y, LLView* other_view) const
+BOOL LLView::localPointToOtherView( S32 x, S32 y, S32 *other_x, S32 *other_y, const LLView* other_view) const
{
const LLView* cur_view = this;
const LLView* root_view = NULL;
@@ -2001,7 +2001,7 @@ BOOL LLView::localPointToOtherView( S32 x, S32 y, S32 *other_x, S32 *other_y, LL
return FALSE;
}
-BOOL LLView::localRectToOtherView( const LLRect& local, LLRect* other, LLView* other_view ) const
+BOOL LLView::localRectToOtherView( const LLRect& local, LLRect* other, const LLView* other_view ) const
{
LLRect cur_rect = local;
const LLView* cur_view = this;
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index d2bbd663b8..61dc4b8030 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -406,8 +406,8 @@ public:
BOOL blockMouseEvent(S32 x, S32 y) const;
// See LLMouseHandler virtuals for screenPointToLocal and localPointToScreen
- BOOL localPointToOtherView( S32 x, S32 y, S32 *other_x, S32 *other_y, LLView* other_view) const;
- BOOL localRectToOtherView( const LLRect& local, LLRect* other, LLView* other_view ) const;
+ BOOL localPointToOtherView( S32 x, S32 y, S32 *other_x, S32 *other_y, const LLView* other_view) const;
+ BOOL localRectToOtherView( const LLRect& local, LLRect* other, const LLView* other_view ) const;
void screenRectToLocal( const LLRect& screen, LLRect* local ) const;
void localRectToScreen( const LLRect& local, LLRect* screen ) const;
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 3d61e13f02..5d5ba03615 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -419,10 +419,6 @@ void LLBottomTray::setVisible(BOOL visible)
{
LLPanel::setVisible(visible);
}
- if(visible)
- gFloaterView->setSnapOffsetBottom(getRect().getHeight());
- else
- gFloaterView->setSnapOffsetBottom(0);
}
S32 LLBottomTray::notifyParent(const LLSD& info)
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index bfdb47dc52..8aaa7f0e13 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -980,16 +980,7 @@ void LLSideTray::reflectCollapseChange()
{
updateSidetrayVisibility();
- if(mCollapsed)
- {
- gFloaterView->setSnapOffsetRight(0);
- setFocus(FALSE);
- }
- else
- {
- gFloaterView->setSnapOffsetRight(getRect().getWidth());
- setFocus(TRUE);
- }
+ setFocus(!mCollapsed);
gFloaterView->refresh();
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index d9c51d03f7..093ce9a67c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1616,6 +1616,7 @@ void LLViewerWindow::initBase()
// Constrain floaters to inside the menu and status bar regions.
gFloaterView = main_view->getChild<LLFloaterView>("Floater View");
+ gFloaterView->setFloaterSnapView(main_view->getChild<LLView>("floater_snap_region")->getHandle());
gSnapshotFloaterView = main_view->getChild<LLSnapshotFloaterView>("Snapshot Floater View");
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index d9991fcae9..e5ae0b950a 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -80,6 +80,13 @@
user_resize="false"
name="hud container"
width="500">
+ <view top="0"
+ follows="all"
+ height="500"
+ left="0"
+ mouse_opaque="false"
+ name="floater_snap_region"
+ width="500"/>
<panel follows="left|top"
height="19"
left="0"
diff --git a/indra/newview/skins/minimal/xui/en/main_view.xml b/indra/newview/skins/minimal/xui/en/main_view.xml
index 18fa332209..a2c16fc9e2 100644
--- a/indra/newview/skins/minimal/xui/en/main_view.xml
+++ b/indra/newview/skins/minimal/xui/en/main_view.xml
@@ -71,6 +71,13 @@
user_resize="false"
name="hud container"
width="500">
+ <view top="0"
+ follows="all"
+ height="500"
+ left="0"
+ mouse_opaque="false"
+ name="floater_snap_region"
+ width="500"/>
<panel follows="left|top"
height="0"
left="0"