Skip to content
Snippets Groups Projects
Commit c4c727fd authored by Seth ProductEngine's avatar Seth ProductEngine
Browse files

STORM-498 FIXED reshaping dockable floater to ensure there is some vertical...

STORM-498 FIXED reshaping dockable floater to ensure there is some vertical space between a floater and a control to which it is docked.
parent 65b3cd14
No related branches found
No related tags found
No related merge requests found
...@@ -220,10 +220,15 @@ void LLDockControl::moveDockable() ...@@ -220,10 +220,15 @@ void LLDockControl::moveDockable()
case TOP: case TOP:
x = dockRect.getCenterX() - dockableRect.getWidth() / 2; x = dockRect.getCenterX() - dockableRect.getWidth() / 2;
y = dockRect.mTop + dockableRect.getHeight(); 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) if (use_tongue)
{ {
y += mDockTongue->getHeight(); y += mDockTongue->getHeight();
if ( y > rootRect.mTop)
{
y = rootRect.mTop;
}
} }
// check is dockable inside root view rect // check is dockable inside root view rect
...@@ -257,7 +262,7 @@ void LLDockControl::moveDockable() ...@@ -257,7 +262,7 @@ void LLDockControl::moveDockable()
case BOTTOM: case BOTTOM:
x = dockRect.getCenterX() - dockableRect.getWidth() / 2; x = dockRect.getCenterX() - dockableRect.getWidth() / 2;
y = dockRect.mBottom; 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) if (use_tongue)
{ {
y -= mDockTongue->getHeight(); y -= mDockTongue->getHeight();
...@@ -292,9 +297,21 @@ void LLDockControl::moveDockable() ...@@ -292,9 +297,21 @@ void LLDockControl::moveDockable()
break; break;
} }
// move dockable S32 max_available_height = rootRect.getHeight() - mDockTongueY - mDockTongue->getHeight();
dockableRect.setLeftTopAndSize(x, y, dockableRect.getWidth(),
dockableRect.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; LLRect localDocableParentRect;
mDockableFloater->getParent()->screenRectToLocal(dockableRect, mDockableFloater->getParent()->screenRectToLocal(dockableRect,
&localDocableParentRect); &localDocableParentRect);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment