Merge remote branch 'origin/master'

This commit is contained in:
irengrig
2013-01-29 20:54:30 +04:00
4 changed files with 26 additions and 1 deletions
@@ -73,6 +73,11 @@ class ComboContentLayout extends ContentLayout {
myComboLabel.setBounds(eachX, eachY, width, bounds.height);
}
@Override
public int getMinimumWidth() {
return myIdLabel != null ? myIdLabel.getPreferredSize().width : 0;
}
@Override
public void paintComponent(Graphics g) {
if (!isToDrawCombo()) return;
@@ -61,6 +61,8 @@ abstract class ContentLayout {
public abstract void rebuild();
public abstract int getMinimumWidth();
public abstract void contentAdded(ContentManagerEvent event);
public abstract void contentRemoved(ContentManagerEvent event);
@@ -253,6 +253,23 @@ class TabContentLayout extends ContentLayout {
myLastLayout = data;
}
@Override
public int getMinimumWidth() {
int result = 0;
if (myIdLabel != null) {
result += myIdLabel.getPreferredSize().width;
Insets insets = myIdLabel.getInsets();
if (insets != null) {
result += insets.left + insets.right;
}
}
if (myLastLayout != null) {
result += myLastLayout.moreRectWidth + myLastLayout.requiredWidth;
result -= myLastLayout.toLayout.size() > 1 ? myLastLayout.moreRectWidth + 1 : -14;
}
return result;
}
static void dropTab(final LayoutData data, final ContentTabLabel toDropLabel) {
data.requiredWidth -= (toDropLabel.getPreferredSize().width + 1);
data.toDrop.add(toDropLabel);
@@ -216,7 +216,8 @@ public class ToolWindowContentUi extends JPanel implements ContentUI, PropertyCh
}
public Dimension getMinimumSize() {
return getPreferredSize();
Insets insets = getInsets();
return new Dimension(insets.left + insets.right + getCurrentLayout().getMinimumWidth(), super.getMinimumSize().height);
}
public Dimension getPreferredSize() {