mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-91089 Unmovable splitter: min-size blocks resize
This commit is contained in:
+5
@@ -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);
|
||||
|
||||
+2
-1
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user