mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-317864 Fix insets handling in Splitter
They were ignored by the layout code, making it impossible to use borders on splitters. And we need one for the Build tool window. GitOrigin-RevId: d730e55ec16de38a4d5280266238932923e1c58d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3a16290557
commit
d879451de7
@@ -418,8 +418,9 @@ public class Splitter extends JPanel implements Splittable {
|
||||
mySkipNextLayout = false;
|
||||
return;
|
||||
}
|
||||
int width = getWidth();
|
||||
int height = getHeight();
|
||||
var insets = getInsets();
|
||||
int width = getWidth() - insets.left - insets.right;
|
||||
int height = getHeight() - insets.top - insets.bottom;
|
||||
|
||||
int total = isVertical() ? height : width;
|
||||
if (total <= 0) return;
|
||||
@@ -445,14 +446,14 @@ public class Splitter extends JPanel implements Splittable {
|
||||
int iSize2 = Math.max(0, total - iSize1 - d);
|
||||
|
||||
if (isVertical()) {
|
||||
firstRect.setBounds(0, 0, width, iSize1);
|
||||
dividerRect.setBounds(0, iSize1, width, d);
|
||||
secondRect.setBounds(0, iSize1 + d, width, iSize2);
|
||||
firstRect.setBounds(insets.left, insets.top, width, iSize1);
|
||||
dividerRect.setBounds(insets.left, insets.top + iSize1, width, d);
|
||||
secondRect.setBounds(insets.left, insets.top + iSize1 + d, width, iSize2);
|
||||
}
|
||||
else {
|
||||
firstRect.setBounds(0, 0, iSize1, height);
|
||||
dividerRect.setBounds(iSize1, 0, d, height);
|
||||
secondRect.setBounds((iSize1 + d), 0, iSize2, height);
|
||||
firstRect.setBounds(insets.left, insets.top, iSize1, height);
|
||||
dividerRect.setBounds(insets.left + iSize1, insets.top, d, height);
|
||||
secondRect.setBounds((insets.left + iSize1 + d), insets.top, iSize2, height);
|
||||
}
|
||||
myDivider.setVisible(true);
|
||||
myFirstComponent.setBounds(firstRect);
|
||||
@@ -464,26 +465,26 @@ public class Splitter extends JPanel implements Splittable {
|
||||
else if (!isNull(myFirstComponent) && myFirstComponent.isVisible()) { // only first component is visible
|
||||
hideNull(mySecondComponent);
|
||||
myDivider.setVisible(false);
|
||||
myFirstComponent.setBounds(0, 0, width, height);
|
||||
myFirstComponent.setBounds(insets.left, insets.top, width, height);
|
||||
//myFirstComponent.revalidate();
|
||||
}
|
||||
else if (!isNull(mySecondComponent) && mySecondComponent.isVisible()) { // only second component is visible
|
||||
hideNull(myFirstComponent);
|
||||
myDivider.setVisible(false);
|
||||
mySecondComponent.setBounds(0, 0, width, height);
|
||||
mySecondComponent.setBounds(insets.left, insets.top, width, height);
|
||||
//mySecondComponent.revalidate();
|
||||
}
|
||||
else { // both components are null or invisible
|
||||
myDivider.setVisible(false);
|
||||
if (myFirstComponent != null) {
|
||||
myFirstComponent.setBounds(0, 0, 0, 0);
|
||||
myFirstComponent.setBounds(insets.left, insets.top, 0, 0);
|
||||
//myFirstComponent.revalidate();
|
||||
}
|
||||
else {
|
||||
hideNull(myFirstComponent);
|
||||
}
|
||||
if (mySecondComponent != null) {
|
||||
mySecondComponent.setBounds(0, 0, 0, 0);
|
||||
mySecondComponent.setBounds(insets.left, insets.top, 0, 0);
|
||||
//mySecondComponent.revalidate();
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user