Index: Eclipse UI/org/eclipse/ui/internal/EditorStack.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorStack.java,v retrieving revision 1.8 diff -u -r1.8 EditorStack.java --- Eclipse UI/org/eclipse/ui/internal/EditorStack.java 17 Jun 2004 19:53:34 -0000 1.8 +++ Eclipse UI/org/eclipse/ui/internal/EditorStack.java 22 Jun 2004 16:52:00 -0000 @@ -86,7 +86,9 @@ public boolean supportsState(int state) { if (page.isFixedLayout()) return false; - return state == IStackPresentationSite.STATE_MAXIMIZED || state == IStackPresentationSite.STATE_RESTORED; + + return true; + //return state == IStackPresentationSite.STATE_MAXIMIZED || state == IStackPresentationSite.STATE_RESTORED; } /** Index: Eclipse UI/org/eclipse/ui/internal/ILayoutContainer.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ILayoutContainer.java,v retrieving revision 1.8 diff -u -r1.8 ILayoutContainer.java --- Eclipse UI/org/eclipse/ui/internal/ILayoutContainer.java 8 May 2004 00:14:14 -0000 1.8 +++ Eclipse UI/org/eclipse/ui/internal/ILayoutContainer.java 22 Jun 2004 16:52:00 -0000 @@ -45,6 +45,14 @@ public void setZoomed(boolean isZoomed); /** + * Called when the preferred size of the given child has changed, requiring a + * layout to be triggered. + * + * @param childThatChanged the child that triggered the new layout + */ +public void resizeChild(LayoutPart childThatChanged); + +/** * Gets the parent for this container. */ //public ILayoutContainer getContainer(); Index: Eclipse UI/org/eclipse/ui/internal/LayoutPart.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutPart.java,v retrieving revision 1.33 diff -u -r1.33 LayoutPart.java --- Eclipse UI/org/eclipse/ui/internal/LayoutPart.java 16 Jun 2004 14:54:31 -0000 1.33 +++ Eclipse UI/org/eclipse/ui/internal/LayoutPart.java 22 Jun 2004 16:52:00 -0000 @@ -77,14 +77,6 @@ public Rectangle getBounds() { return new Rectangle(0, 0, 0, 0); } -// /** -// * Gets root container for this part. -// */ -// public ViewSashContainer getRootContainer() { -// if (container != null) -// return container.getRootContainer(); -// return null; -// } /** * Gets the parent for this part. @@ -368,6 +360,17 @@ */ public String getPlaceHolderId() { return getID(); +} + +public void resizeChild(LayoutPart childThatChanged) { + +} + +public void forceLayout() { + ILayoutContainer container = getContainer(); + if (getContainer() != null) { + container.resizeChild(this); + } } /** Index: Eclipse UI/org/eclipse/ui/internal/LayoutTreeNode.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutTreeNode.java,v retrieving revision 1.13 diff -u -r1.13 LayoutTreeNode.java --- Eclipse UI/org/eclipse/ui/internal/LayoutTreeNode.java 27 May 2004 21:25:55 -0000 1.13 +++ Eclipse UI/org/eclipse/ui/internal/LayoutTreeNode.java 22 Jun 2004 16:52:00 -0000 @@ -335,14 +335,14 @@ sashBounds.width = SASH_WIDTH; if (children[0].fixedHeight()) { - leftBounds.height = children[0].getBounds().height; + leftBounds.height = children[0].getMinimumHeight(); } rightBounds.x = sashBounds.x + sashBounds.width; rightBounds.width = bounds.x + bounds.width - rightBounds.x; if (children[1].fixedHeight()) { - rightBounds.height = children[1].getBounds().height; + rightBounds.height = children[1].getMinimumHeight(); } adjustWidths(bounds, leftBounds, rightBounds, sashBounds); @@ -351,9 +351,9 @@ int redistribute = bounds.height - SASH_WIDTH - total; if (children[0].fixedHeight()) { - leftBounds.height = children[0].getBounds().height; + leftBounds.height = children[0].getMinimumHeight(); } else if (children[1].fixedHeight()) { - leftBounds.height = bounds.height - children[1].getBounds().height - SASH_WIDTH; + leftBounds.height = bounds.height - children[1].getMinimumHeight() - SASH_WIDTH; } else { leftBounds.height = left + (int)Math.round(redistribute * wLeft / wTotal); } @@ -362,7 +362,7 @@ rightBounds.y = sashBounds.y + sashBounds.height; if (children[1].fixedHeight()) { - rightBounds.height = children[1].getBounds().height; + rightBounds.height = children[1].getMinimumHeight(); } else { rightBounds.height = bounds.y + bounds.height - rightBounds.y; } Index: Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java,v retrieving revision 1.27 diff -u -r1.27 PartSashContainer.java --- Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java 8 Jun 2004 19:46:21 -0000 1.27 +++ Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java 22 Jun 2004 16:52:00 -0000 @@ -575,6 +575,16 @@ return (unzoomRoot != null); } +/* (non-Javadoc) + * @see org.eclipse.ui.internal.LayoutPart#forceLayout(org.eclipse.ui.internal.LayoutPart) + */ +public void resizeChild(LayoutPart childThatChanged) { + forceLayout(); + + if (root != null) { + root.setBounds(getParent().getClientArea()); + } +} /** * Remove a part. */ @@ -960,6 +970,16 @@ info.right = right; info.relative = relative; addChild(info); +} + +/* (non-Javadoc) + * @see org.eclipse.ui.internal.LayoutPart#resizesVertically() + */ +public boolean resizesVertically() { + if (root == null) { + return true; + } + return !root.fixedHeight(); } /* (non-Javadoc) Index: Eclipse UI/org/eclipse/ui/internal/PartStack.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java,v retrieving revision 1.29 diff -u -r1.29 PartStack.java --- Eclipse UI/org/eclipse/ui/internal/PartStack.java 17 Jun 2004 19:53:34 -0000 1.29 +++ Eclipse UI/org/eclipse/ui/internal/PartStack.java 22 Jun 2004 16:52:00 -0000 @@ -465,16 +465,6 @@ } refreshPresentationSelection(); - - Rectangle bounds = presentation.getControl().getBounds(); - int minimumHeight = getMinimumHeight(); - - if (presentationSite.getState() == IStackPresentationSite.STATE_MINIMIZED - && bounds.height != minimumHeight) { - bounds.width = getMinimumWidth(); - bounds.height = minimumHeight; - getPresentation().setBounds(bounds); - } } /** @@ -527,17 +517,6 @@ } /** - * Forces the layout to be recomputed for all parts - */ - private void forceLayout() { - PartSashContainer cont = (PartSashContainer) getContainer(); - if (cont != null) { - LayoutTree tree = cont.getLayoutTree(); - tree.setBounds(getParent().getClientArea()); - } - } - - /** * Gets the presentation bounds. */ public Rectangle getBounds() { @@ -886,7 +865,7 @@ */ public void setActive(int activeState) { - if (activeState != StackPresentation.AS_INACTIVE) { + if (activeState == StackPresentation.AS_ACTIVE_FOCUS) { if (presentationSite.getState() == IStackPresentationSite.STATE_MINIMIZED) { setState(IStackPresentationSite.STATE_RESTORED); } @@ -968,11 +947,7 @@ page.zoomOut(); } - updateControlBounds(); - - if (oldState == IStackPresentationSite.STATE_MINIMIZED) { - forceLayout(); - } + forceLayout(); } } } @@ -1066,24 +1041,6 @@ } setSelection(selPart); - } - - private void updateControlBounds() { - StackPresentation presentation = getPresentation(); - - if (presentation != null) { - Rectangle bounds = presentation.getControl().getBounds(); - int minimumHeight = getMinimumHeight(); - - if (presentationSite.getState() == IStackPresentationSite.STATE_MINIMIZED - && bounds.height != minimumHeight) { - bounds.width = getMinimumWidth(); - bounds.height = minimumHeight; - getPresentation().setBounds(bounds); - - forceLayout(); - } - } } /**