diff options
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: | 
