From 57e5cb5d5c1f38d09c7ef3e5249194e8c11a9064 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Tue, 9 Feb 2016 23:06:19 +0300 Subject: [PATCH] IDEA-151449 JBScrollPane adds 14px space at the bottom of my component. --- .../src/com/intellij/ui/components/JBViewport.java | 9 +-------- .../src/com/intellij/vcs/log/ui/frame/DetailsPanel.java | 7 +------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ui/components/JBViewport.java b/platform/platform-api/src/com/intellij/ui/components/JBViewport.java index d0255b6f6460..4a861d0a8e93 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBViewport.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBViewport.java @@ -323,14 +323,7 @@ public class JBViewport extends JViewport implements ZoomableViewport { @Override public void paintBorder(Component view, Graphics g, int x, int y, int width, int height) { if (myBorder != null) { - if (view instanceof JComponent) { - Insets insets = new Insets(0, 0, 0, 0); - addViewInsets((JComponent)view, insets); - x += insets.left; - y += insets.top; - width -= insets.left + insets.right; - height -= insets.top + insets.bottom; - } + // additional insets are used inside a custom border myBorder.paintBorder(view, g, x, y, width, height); } } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/DetailsPanel.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/DetailsPanel.java index 28806fabe98b..141676adc1ec 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/DetailsPanel.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/DetailsPanel.java @@ -105,12 +105,7 @@ class DetailsPanel extends JPanel implements ListSelectionListener { myReferencesPanel = new ReferencesPanel(myColorManager); myCommitDetailsPanel = new DataPanel(logDataHolder.getProject(), logDataHolder.isMultiRoot(), logDataHolder); - myScrollPane = new JBScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED) { - @Override - protected JViewport createViewport() { - return new JViewport(); - } - }; + myScrollPane = new JBScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); myScrollPane.getVerticalScrollBar().setUnitIncrement(8); myMainContentPanel = new JPanel(new MigLayout("flowy, ins 0, hidemode 3, gapy 0")) { @Override