From 95c710d60441a4445201dffc986e763b217fe13e Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Thu, 11 Dec 2014 18:37:17 +0300 Subject: [PATCH] get rid of double border between editor header component and editor in case of tab placement != top --- .../intellij/openapi/editor/impl/EditorHeaderComponent.java | 3 +-- .../src/com/intellij/openapi/editor/impl/EditorImpl.java | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorHeaderComponent.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorHeaderComponent.java index 0833319cc010..48f5adce9957 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorHeaderComponent.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorHeaderComponent.java @@ -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 diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 13f48760db7c..89f8133449de 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -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() {