From 191fdd673858ebbf036b3ec4fd7220ff734f1c68 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Thu, 20 Aug 1998 00:48:01 +0000 Subject: [PATCH] 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 --- mozilla/cmd/macfe/gui/CBrowserWindow.cp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/cmd/macfe/gui/CBrowserWindow.cp b/mozilla/cmd/macfe/gui/CBrowserWindow.cp index 7a1187fbd1e..a24af924438 100644 --- a/mozilla/cmd/macfe/gui/CBrowserWindow.cp +++ b/mozilla/cmd/macfe/gui/CBrowserWindow.cp @@ -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 );