diff options
author | Rick Pasetto <rick@lindenlab.com> | 2010-02-11 14:05:44 -0800 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2010-02-11 14:05:44 -0800 |
commit | 53d827781eb17100ae4784e19a4d59e23c59bf6d (patch) | |
tree | 801c3c509ebc6f5b58c9b9ee3898f178e2f922a7 /indra/llui | |
parent | dc61885aa6d0894c913f3ce7ede410d1c18ce089 (diff) | |
parent | 234f5a48a70d92e00aded1003814b2b883fa5ef4 (diff) |
Merge from viewer-2-0
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lldockcontrol.cpp | 41 | ||||
-rw-r--r-- | indra/llui/lldockcontrol.h | 5 |
2 files changed, 44 insertions, 2 deletions
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index d836a5f4cd..f91c07184d 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -162,7 +162,9 @@ bool LLDockControl::isDockVisible() { case LEFT: // to keep compiler happy break; + case BOTTOM: case TOP: + { // check is dock inside parent rect LLRect dockParentRect = mDockWidget->getParent()->calcScreenRect(); @@ -173,6 +175,9 @@ bool LLDockControl::isDockVisible() } break; } + default: + break; + } } } @@ -255,6 +260,42 @@ void LLDockControl::moveDockable() mDockTongueY = dockRect.mTop; break; + case BOTTOM: + x = dockRect.getCenterX() - dockableRect.getWidth() / 2; + y = dockRect.mBottom; + // unique docking used with dock tongue, so add tongue height o the Y coordinate + if (use_tongue) + { + y -= mDockTongue->getHeight(); + } + + // check is dockable inside root view rect + if (x < rootRect.mLeft) + { + x = rootRect.mLeft; + } + if (x + dockableRect.getWidth() > rootRect.mRight) + { + x = rootRect.mRight - dockableRect.getWidth(); + } + + // calculate dock tongue position + dockParentRect = mDockWidget->getParent()->calcScreenRect(); + if (dockRect.getCenterX() < dockParentRect.mLeft) + { + mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2; + } + else if (dockRect.getCenterX() > dockParentRect.mRight) + { + mDockTongueX = dockParentRect.mRight - mDockTongue->getWidth() / 2;; + } + else + { + mDockTongueX = dockRect.getCenterX() - mDockTongue->getWidth() / 2; + } + mDockTongueY = dockRect.mTop + mDockTongue->getHeight(); + + break; } // move dockable diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index 550955c4c5..a5caf68001 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -47,8 +47,9 @@ class LLDockControl public: enum DocAt { - TOP - ,LEFT + TOP, + LEFT, + BOTTOM }; public: |