diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java index 967552f537ed..f1c4d085f72d 100644 --- a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java +++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java @@ -320,22 +320,26 @@ public class JBTabsImpl extends JComponent } boolean oldHideTabsIfNeed = mySingleRowLayout instanceof ScrollableSingleRowLayout; boolean newHideTabsIfNeed = UISettings.getInstance().getHideTabsIfNeed(); - boolean wasSingleRow = isSingleRow(); if (oldHideTabsIfNeed != newHideTabsIfNeed) { - if (mySingleRowLayout != null) { - remove(mySingleRowLayout.myLeftGhost); - remove(mySingleRowLayout.myRightGhost); - } - mySingleRowLayout = createSingleRowLayout(); - if (wasSingleRow) { - myLayout = mySingleRowLayout; - } - add(mySingleRowLayout.myLeftGhost); - add(mySingleRowLayout.myRightGhost); - relayout(true, true); + updateRowLayout(); } } + private void updateRowLayout() { + boolean wasSingleRow = isSingleRow(); + if (mySingleRowLayout != null) { + remove(mySingleRowLayout.myLeftGhost); + remove(mySingleRowLayout.myRightGhost); + } + mySingleRowLayout = createSingleRowLayout(); + if (wasSingleRow) { + myLayout = mySingleRowLayout; + } + add(mySingleRowLayout.myLeftGhost); + add(mySingleRowLayout.myRightGhost); + relayout(true, true); + } + protected SingleRowLayout createSingleRowLayout() { return new SingleRowLayout(this); } @@ -3292,6 +3296,7 @@ public class JBTabsImpl extends JComponent @Override public JBTabsPresentation setSupportsCompression(boolean supportsCompression) { mySupportsCompression = supportsCompression; + updateRowLayout(); return this; }