From 7caf0f997415430c4cb0f7be309254fe8d07a733 Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Tue, 14 Jan 2020 21:08:40 +0300 Subject: [PATCH] vcs: Use horizontal toolbar in "Shelf" tab for "Commit" tool window GitOrigin-RevId: b761d5feec8add18a3c870d44393f912322e0bec --- .../vcs/changes/shelf/ShelvedChangesViewManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java index bdc5814de721..fa65cff3033f 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java @@ -81,6 +81,7 @@ import static com.intellij.openapi.vcs.changes.shelf.DiffShelvedChangesActionPro import static com.intellij.openapi.vcs.changes.ui.ChangesGroupingSupport.REPOSITORY_GROUPING; import static com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager.SHELF; import static com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager.getToolWindowFor; +import static com.intellij.openapi.vcs.changes.ui.ChangesViewContentManagerKt.isCommitToolWindow; import static com.intellij.util.FontUtil.spaceAndThinSpace; import static com.intellij.util.ObjectUtils.assertNotNull; import static com.intellij.util.containers.ContainerUtil.*; @@ -692,13 +693,14 @@ public class ShelvedChangesViewManager implements Disposable { MyShelvedPreviewProcessor changeProcessor = new MyShelvedPreviewProcessor(myProject, myTree); Disposer.register(this, changeProcessor); - ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("ShelvedChanges", actionGroup, false); + boolean isToolbarHorizontal = isCommitToolWindow().asBoolean(); + ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("ShelvedChanges", actionGroup, isToolbarHorizontal); myRootPanel = new JPanel(new BorderLayout()); - myRootPanel.add(toolbar.getComponent(), BorderLayout.WEST); + myRootPanel.add(toolbar.getComponent(), isToolbarHorizontal ? BorderLayout.NORTH : BorderLayout.WEST); if (Registry.is("show.diff.preview.as.editor.tab")) { - myDiffPreview = new EditorTabPreview(changeProcessor, pane, myTree){ + myDiffPreview = new EditorTabPreview(changeProcessor, pane, myTree) { @Override protected boolean skipPreviewUpdate() {