diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserBase.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserBase.java index 51a8a825d7c2..a1418535a143 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserBase.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserBase.java @@ -6,7 +6,6 @@ import com.intellij.diff.DiffManager; import com.intellij.diff.chains.DiffRequestChain; import com.intellij.diff.util.DiffUserDataKeys; import com.intellij.diff.util.DiffUtil; -import com.intellij.ide.actions.NewActionGroup; import com.intellij.openapi.ListSelection; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.ActionUtil; @@ -35,7 +34,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.function.Predicate; /** * Consider using {@link AsyncChangesBrowserBase} to avoid potentially-expensive tree building operations on EDT. @@ -107,19 +105,9 @@ public abstract class ChangesBrowserBase extends JPanel implements DataProvider add(createCenterPanel(), BorderLayout.CENTER); myToolBarGroup.addAll(createToolbarActions()); + myToolBarGroup.addAll(createLastToolbarActions()); myPopupMenuGroup.addAll(createPopupMenuActions()); - AnAction groupByAction = ActionManager.getInstance().getAction(ChangesTree.GROUP_BY_ACTION_GROUP); - if (!NewActionGroup.anyActionFromGroupMatches(myToolBarGroup, true, Predicate.isEqual(groupByAction))) { - myToolBarGroup.addSeparator(); - myToolBarGroup.add(groupByAction); - } - - if (isVerticalToolbar()) { - myToolBarGroup.addSeparator(); - myToolBarGroup.addAll(TreeActionsToolbarPanel.createTreeActions()); - } - myShowDiffAction.registerCustomShortcutSet(this, null); DiffUtil.recursiveRegisterShortcutSet(myToolBarGroup, this, null); } @@ -187,6 +175,18 @@ public abstract class ChangesBrowserBase extends JPanel implements DataProvider return Collections.singletonList(myShowDiffAction); } + @NotNull + protected List createLastToolbarActions() { + List result = new ArrayList<>(); + result.add(Separator.getInstance()); + result.add(ActionManager.getInstance().getAction(ChangesTree.GROUP_BY_ACTION_GROUP)); + if (isVerticalToolbar()) { + result.add(Separator.getInstance()); + result.addAll(TreeActionsToolbarPanel.createTreeActions()); + } + return result; + } + @NotNull protected List createPopupMenuActions() { List actions = new ArrayList<>(); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogChangesBrowser.kt b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogChangesBrowser.kt index 691888c60881..0ebb40db8acf 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogChangesBrowser.kt +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogChangesBrowser.kt @@ -136,6 +136,10 @@ class VcsLogChangesBrowser internal constructor(project: Project, ) } + override fun createLastToolbarActions(): List { + return emptyList() // do not duplicate 'ChangesView.GroupBy' group + } + override fun createPopupMenuActions(): List { return ContainerUtil.append( super.createPopupMenuActions(),