From a510e472d990c1ceb21445edd43dbab0378c4050 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 18 Mar 2016 14:27:48 +0300 Subject: [PATCH] IDEA-149395 minimize disabled scroll bars --- .../src/com/intellij/ui/components/JBScrollPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java b/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java index bed6538c5a48..d0e7e2d95506 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java @@ -735,7 +735,7 @@ public class JBScrollPane extends JScrollPane { } private void adjustForVSB(Rectangle bounds, Insets insets, Rectangle vsbBounds, boolean vsbOpaque, boolean vsbOnLeft) { - vsbBounds.width = min(bounds.width, vsb.getPreferredSize().width); + vsbBounds.width = !vsb.isEnabled() ? 0 : min(bounds.width, vsb.getPreferredSize().width); if (vsbOnLeft) { vsbBounds.x = bounds.x - insets.left/* + vsbBounds.width*/; if (vsbOpaque) bounds.x += vsbBounds.width; @@ -747,7 +747,7 @@ public class JBScrollPane extends JScrollPane { } private void adjustForHSB(Rectangle bounds, Insets insets, Rectangle hsbBounds, boolean hsbOpaque, boolean hsbOnTop) { - hsbBounds.height = min(bounds.height, hsb.getPreferredSize().height); + hsbBounds.height = !hsb.isEnabled() ? 0 : min(bounds.height, hsb.getPreferredSize().height); if (hsbOnTop) { hsbBounds.y = bounds.y - insets.top/* + hsbBounds.height*/; if (hsbOpaque) bounds.y += hsbBounds.height;