View | Details | Raw Unified | Return to bug 25303
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/EditorStack.java (-1 / +3 lines)
Lines 86-92 Link Here
86
	public boolean supportsState(int state) {
86
	public boolean supportsState(int state) {
87
	    if (page.isFixedLayout())
87
	    if (page.isFixedLayout())
88
	        return false;
88
	        return false;
89
		return state == IStackPresentationSite.STATE_MAXIMIZED || state == IStackPresentationSite.STATE_RESTORED;
89
	    
90
	    return true;
91
		//return state == IStackPresentationSite.STATE_MAXIMIZED || state == IStackPresentationSite.STATE_RESTORED;
90
	}
92
	}
91
93
92
    /**
94
    /**
(-)Eclipse UI/org/eclipse/ui/internal/ILayoutContainer.java (+8 lines)
Lines 45-50 Link Here
45
public void setZoomed(boolean isZoomed);
45
public void setZoomed(boolean isZoomed);
46
46
47
/**
47
/**
48
 * Called when the preferred size of the given child has changed, requiring a
49
 * layout to be triggered.
50
 * 
51
 * @param childThatChanged the child that triggered the new layout
52
 */
53
public void resizeChild(LayoutPart childThatChanged);
54
55
/**
48
 * Gets the parent for this container.
56
 * Gets the parent for this container.
49
 */
57
 */
50
//public ILayoutContainer getContainer();
58
//public ILayoutContainer getContainer();
(-)Eclipse UI/org/eclipse/ui/internal/LayoutPart.java (-8 / +11 lines)
Lines 77-90 Link Here
77
	public Rectangle getBounds() {
77
	public Rectangle getBounds() {
78
		return new Rectangle(0, 0, 0, 0);
78
		return new Rectangle(0, 0, 0, 0);
79
	}
79
	}
80
//	/**
81
//	 * Gets root container for this part.
82
//	 */
83
//	public ViewSashContainer getRootContainer() {
84
//		if (container != null)
85
//			return container.getRootContainer();
86
//		return null;
87
//	}
88
	
80
	
89
	/**
81
	/**
90
	 * Gets the parent for this part.
82
	 * Gets the parent for this part.
Lines 368-373 Link Here
368
 */
360
 */
369
public String getPlaceHolderId() {
361
public String getPlaceHolderId() {
370
    return getID();
362
    return getID();
363
}
364
365
public void resizeChild(LayoutPart childThatChanged) {
366
367
}
368
369
public void forceLayout() {
370
	ILayoutContainer container = getContainer();
371
	if (getContainer() != null) {
372
		container.resizeChild(this);
373
	}
371
}
374
}
372
375
373
/**
376
/**
(-)Eclipse UI/org/eclipse/ui/internal/LayoutTreeNode.java (-5 / +5 lines)
Lines 335-348 Link Here
335
		sashBounds.width = SASH_WIDTH;
335
		sashBounds.width = SASH_WIDTH;
336
		
336
		
337
		if (children[0].fixedHeight()) {
337
		if (children[0].fixedHeight()) {
338
			leftBounds.height = children[0].getBounds().height;
338
			leftBounds.height = children[0].getMinimumHeight();
339
		}
339
		}
340
		
340
		
341
		rightBounds.x = sashBounds.x + sashBounds.width;
341
		rightBounds.x = sashBounds.x + sashBounds.width;
342
		rightBounds.width = bounds.x + bounds.width - rightBounds.x;
342
		rightBounds.width = bounds.x + bounds.width - rightBounds.x;
343
		
343
		
344
		if (children[1].fixedHeight()) {
344
		if (children[1].fixedHeight()) {
345
			rightBounds.height = children[1].getBounds().height;
345
			rightBounds.height = children[1].getMinimumHeight();
346
		}
346
		}
347
		
347
		
348
		adjustWidths(bounds, leftBounds, rightBounds, sashBounds);
348
		adjustWidths(bounds, leftBounds, rightBounds, sashBounds);
Lines 351-359 Link Here
351
		int redistribute = bounds.height - SASH_WIDTH - total;
351
		int redistribute = bounds.height - SASH_WIDTH - total;
352
352
353
		if (children[0].fixedHeight()) {
353
		if (children[0].fixedHeight()) {
354
			leftBounds.height = children[0].getBounds().height;
354
			leftBounds.height = children[0].getMinimumHeight();
355
		} else if (children[1].fixedHeight()) {
355
		} else if (children[1].fixedHeight()) {
356
			leftBounds.height = bounds.height - children[1].getBounds().height - SASH_WIDTH;
356
			leftBounds.height = bounds.height - children[1].getMinimumHeight() - SASH_WIDTH;
357
		} else {
357
		} else {
358
			leftBounds.height = left + (int)Math.round(redistribute * wLeft / wTotal);
358
			leftBounds.height = left + (int)Math.round(redistribute * wLeft / wTotal);
359
		}
359
		}
Lines 362-368 Link Here
362
		rightBounds.y = sashBounds.y + sashBounds.height;
362
		rightBounds.y = sashBounds.y + sashBounds.height;
363
		
363
		
364
		if (children[1].fixedHeight()) {
364
		if (children[1].fixedHeight()) {
365
			rightBounds.height = children[1].getBounds().height;
365
			rightBounds.height = children[1].getMinimumHeight();
366
		} else {
366
		} else {
367
			rightBounds.height = bounds.y + bounds.height - rightBounds.y;
367
			rightBounds.height = bounds.y + bounds.height - rightBounds.y;
368
		}
368
		}
(-)Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java (+20 lines)
Lines 575-580 Link Here
575
	return (unzoomRoot != null);
575
	return (unzoomRoot != null);
576
}
576
}
577
577
578
/* (non-Javadoc)
579
 * @see org.eclipse.ui.internal.LayoutPart#forceLayout(org.eclipse.ui.internal.LayoutPart)
580
 */
581
public void resizeChild(LayoutPart childThatChanged) {
582
	forceLayout();
583
	
584
	if (root != null) {
585
		root.setBounds(getParent().getClientArea());
586
	}
587
}
578
/**
588
/**
579
 * Remove a part.
589
 * Remove a part.
580
 */ 
590
 */ 
Lines 960-965 Link Here
960
	info.right = right;
970
	info.right = right;
961
	info.relative = relative;
971
	info.relative = relative;
962
	addChild(info);
972
	addChild(info);
973
}
974
975
/* (non-Javadoc)
976
 * @see org.eclipse.ui.internal.LayoutPart#resizesVertically()
977
 */
978
public boolean resizesVertically() {
979
	if (root == null) {
980
		return true;
981
	}
982
	return !root.fixedHeight();
963
}
983
}
964
984
965
/* (non-Javadoc)
985
/* (non-Javadoc)
(-)Eclipse UI/org/eclipse/ui/internal/PartStack.java (-45 / +2 lines)
Lines 465-480 Link Here
465
        }
465
        }
466
        
466
        
467
        refreshPresentationSelection();
467
        refreshPresentationSelection();
468
        
469
        Rectangle bounds = presentation.getControl().getBounds();
470
        int minimumHeight = getMinimumHeight();
471
472
        if (presentationSite.getState() == IStackPresentationSite.STATE_MINIMIZED
473
                && bounds.height != minimumHeight) {
474
            bounds.width = getMinimumWidth();
475
            bounds.height = minimumHeight;
476
            getPresentation().setBounds(bounds);
477
        }
478
    }
468
    }
479
469
480
    /**
470
    /**
Lines 527-543 Link Here
527
    }
517
    }
528
518
529
    /**
519
    /**
530
     * Forces the layout to be recomputed for all parts
531
     */
532
    private void forceLayout() {
533
        PartSashContainer cont = (PartSashContainer) getContainer();
534
        if (cont != null) {
535
            LayoutTree tree = cont.getLayoutTree();
536
            tree.setBounds(getParent().getClientArea());
537
        }
538
    }
539
540
    /**
541
     * Gets the presentation bounds.
520
     * Gets the presentation bounds.
542
     */
521
     */
543
    public Rectangle getBounds() {
522
    public Rectangle getBounds() {
Lines 886-892 Link Here
886
     */
865
     */
887
    public void setActive(int activeState) {
866
    public void setActive(int activeState) {
888
    	
867
    	
889
        if (activeState != StackPresentation.AS_INACTIVE) {
868
        if (activeState == StackPresentation.AS_ACTIVE_FOCUS) {
890
            if (presentationSite.getState() == IStackPresentationSite.STATE_MINIMIZED) {
869
            if (presentationSite.getState() == IStackPresentationSite.STATE_MINIMIZED) {
891
                setState(IStackPresentationSite.STATE_RESTORED);
870
                setState(IStackPresentationSite.STATE_RESTORED);
892
            }            
871
            }            
Lines 968-978 Link Here
968
	                    page.zoomOut();
947
	                    page.zoomOut();
969
	                }
948
	                }
970
	
949
	
971
	                updateControlBounds();
950
	                forceLayout();
972
	
973
	                if (oldState == IStackPresentationSite.STATE_MINIMIZED) {
974
	                    forceLayout();
975
	                }
976
                }
951
                }
977
            }
952
            }
978
        }
953
        }
Lines 1066-1089 Link Here
1066
        }
1041
        }
1067
        
1042
        
1068
        setSelection(selPart);
1043
        setSelection(selPart);
1069
    }
1070
1071
    private void updateControlBounds() {
1072
    	StackPresentation presentation = getPresentation();
1073
    	
1074
    	if (presentation != null) {
1075
	        Rectangle bounds = presentation.getControl().getBounds();
1076
	        int minimumHeight = getMinimumHeight();
1077
	
1078
	        if (presentationSite.getState() == IStackPresentationSite.STATE_MINIMIZED
1079
	                && bounds.height != minimumHeight) {
1080
	            bounds.width = getMinimumWidth();
1081
	            bounds.height = minimumHeight;
1082
	            getPresentation().setBounds(bounds);
1083
	
1084
	            forceLayout();
1085
	        }
1086
    	}
1087
    }
1044
    }
1088
1045
1089
	/**
1046
	/**

Return to bug 25303