From e31a377126dfa8505b5ffb074871b25124b888f7 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 24 Feb 2012 13:30:06 +0100 Subject: [PATCH] fix scroll in view on selecting tab from "more tabs" popup --- .../ui/tabs/impl/singleRow/ScrollableSingleRowLayout.java | 8 ++++++++ .../intellij/ui/tabs/impl/singleRow/SingleRowLayout.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/ScrollableSingleRowLayout.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/ScrollableSingleRowLayout.java index 20ef48854089..a0ecf0236db7 100644 --- a/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/ScrollableSingleRowLayout.java +++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/ScrollableSingleRowLayout.java @@ -46,6 +46,14 @@ public class ScrollableSingleRowLayout extends SingleRowLayout { } } + @Override + protected boolean checkLayoutLabels(SingleRowPassInfo data) { + if (myScrollSelectionInViewPending) { + return true; + } + return super.checkLayoutLabels(data); + } + private void clampScrollOffsetToBounds(SingleRowPassInfo data) { if (data.requiredLength < data.toFitLength) { myScrollOffset = 0; diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java index 02e751d09718..4366cd5aa2d0 100644 --- a/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java +++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java @@ -101,7 +101,7 @@ public class SingleRowLayout extends TabLayout { return null; } - private boolean checkLayoutLabels(SingleRowPassInfo data) { + protected boolean checkLayoutLabels(SingleRowPassInfo data) { boolean layoutLabels = true; if (!myTabs.myForcedRelayout &&