Don't let popdown tree go off the right side of window. Push it back to left if it would.

git-svn-id: svn://10.0.0.236/trunk@8228 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pinkerton%netscape.com
1998-08-20 00:48:01 +00:00
parent 0f9d2f989b
commit 191fdd6738

View File

@@ -1864,6 +1864,7 @@ CBrowserWindow :: PopDownTreeView ( Uint16 inLeft, Uint16 inTop, HT_Resource inR
const Uint16 kMaxTreeHeight = 700;
const Uint16 kTreeWidth = 250;
const float kHeightPercentage = 0.8; // 80%
const Uint16 kExtraPadding = 5;
SDimension16 browserFrame;
GetFrameSize ( browserFrame );
@@ -1874,6 +1875,11 @@ CBrowserWindow :: PopDownTreeView ( Uint16 inLeft, Uint16 inTop, HT_Resource inR
if ( newHeight > kMaxTreeHeight )
newHeight = kMaxTreeHeight;
// make sure we don't allow it to go off the right side of the browser by pulling it
// back to the left just enough to still fit (like menus)
if ( inLeft + kTreeWidth > browserFrame.width )
inLeft = browserFrame.width - kTreeWidth - kExtraPadding;
mPopdownParent->ResizeFrameTo ( kTreeWidth, newHeight, false );
mPopdownParent->PlaceInSuperImageAt ( inLeft, inTop, false );
mPopdownParent->BuildHTPane ( inResource );