diff options
author | Oz Linden <oz@lindenlab.com> | 2011-01-24 11:44:43 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-01-24 11:44:43 -0500 |
commit | f57aa3e83f1b4286b1d6b5cc8bca20fb924cb002 (patch) | |
tree | 12dae11397876ce10d75eeabe5b1656ea18cd6ac /indra/llui/lldockcontrol.cpp | |
parent | b429ff8ec3e1aebc60ff7f4d3376cfc8b9f2e669 (diff) | |
parent | f9b9c7a5816cf0b9627a4a50e73a663667937145 (diff) |
merge changes for i18n fixes
Diffstat (limited to 'indra/llui/lldockcontrol.cpp')
-rw-r--r-- | indra/llui/lldockcontrol.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index d48674f306..f6f5a0beb3 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -220,10 +220,15 @@ void LLDockControl::moveDockable() case TOP: x = dockRect.getCenterX() - dockableRect.getWidth() / 2; y = dockRect.mTop + dockableRect.getHeight(); - // unique docking used with dock tongue, so add tongue height o the Y coordinate + // unique docking used with dock tongue, so add tongue height to the Y coordinate if (use_tongue) { y += mDockTongue->getHeight(); + + if ( y > rootRect.mTop) + { + y = rootRect.mTop; + } } // check is dockable inside root view rect @@ -257,7 +262,7 @@ void LLDockControl::moveDockable() 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 + // unique docking used with dock tongue, so add tongue height to the Y coordinate if (use_tongue) { y -= mDockTongue->getHeight(); @@ -292,9 +297,21 @@ void LLDockControl::moveDockable() break; } - // move dockable - dockableRect.setLeftTopAndSize(x, y, dockableRect.getWidth(), - dockableRect.getHeight()); + S32 max_available_height = rootRect.getHeight() - mDockTongueY - mDockTongue->getHeight(); + + // A floater should be shrunk so it doesn't cover a part of its docking tongue and + // there is a space between a dockable floater and a control to which it is docked. + if (use_tongue && dockableRect.getHeight() >= max_available_height) + { + dockableRect.setLeftTopAndSize(x, y, dockableRect.getWidth(), max_available_height); + mDockableFloater->reshape(dockableRect.getWidth(), dockableRect.getHeight()); + } + else + { + // move dockable + dockableRect.setLeftTopAndSize(x, y, dockableRect.getWidth(), + dockableRect.getHeight()); + } LLRect localDocableParentRect; mDockableFloater->getParent()->screenRectToLocal(dockableRect, &localDocableParentRect); |