get rid of double border between editor header component and editor in case of tab placement != top

This commit is contained in:
Sergey Ignatov
2014-12-11 18:38:30 +03:00
parent b34db87ed9
commit 95c710d604
2 changed files with 5 additions and 3 deletions
@@ -28,10 +28,9 @@ import java.awt.*;
* @author gregsh
*/
public class EditorHeaderComponent extends JPanel {
public EditorHeaderComponent() {
super(new BorderLayout(0, 0));
setBorder(new CustomLineBorder(JBColor.border(), 0, UIUtil.isUnderGTKLookAndFeel()? 0 : 1, 1, 0));
setBorder(new CustomLineBorder(JBColor.border(), 0, 0, 1, 0));
}
@Override
@@ -6832,7 +6832,10 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
Container splitters = SwingUtilities.getAncestorOfClass(EditorsSplitters.class, c);
boolean thereIsSomethingAbove = !SystemInfo.isMac || UISettings.getInstance().SHOW_MAIN_TOOLBAR || UISettings.getInstance().SHOW_NAVIGATION_BAR ||
toolWindowIsNotEmpty();
return splitters == null ? super.getBorderInsets(c) : new Insets(thereIsSomethingAbove ? 1 : 0, 0, 0, 0);
//noinspection ConstantConditions
Component header = myHeaderPanel == null ? null : ArrayUtil.getFirstElement(myHeaderPanel.getComponents());
boolean paintTop = thereIsSomethingAbove && header == null && UISettings.getInstance().EDITOR_TAB_PLACEMENT != SwingConstants.TOP;
return splitters == null ? super.getBorderInsets(c) : new Insets(paintTop ? 1 : 0, 0, 0, 0);
}
public boolean toolWindowIsNotEmpty() {