From c7a268968389cbeb75355ff29a826561bfc2b737 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Mon, 2 Jul 2018 01:21:54 +0300 Subject: [PATCH] [vcs-log] move selected filter up in the recent list --- .../vcs/log/impl/VcsLogProjectTabsProperties.java | 4 +--- .../log/ui/filter/BranchFilterPopupComponent.java | 4 ++-- .../ui/filter/MultipleValueFilterPopupComponent.java | 12 ++++-------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogProjectTabsProperties.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogProjectTabsProperties.java index 1521d3abcdc6..087bbbbadea1 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogProjectTabsProperties.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogProjectTabsProperties.java @@ -107,9 +107,7 @@ public class VcsLogProjectTabsProperties implements PersistentStateComponent RECENTLY_FILTERED_VALUES_LIMIT) { recentGroups.remove(recentGroups.size() - 1); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/BranchFilterPopupComponent.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/BranchFilterPopupComponent.java index 8e5244bc392c..ba87eccd67c6 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/BranchFilterPopupComponent.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/BranchFilterPopupComponent.java @@ -118,7 +118,7 @@ public class BranchFilterPopupComponent extends MultipleValueFilterPopupComponen @Override protected void createFavoritesAction(@NotNull DefaultActionGroup actionGroup, @NotNull List favorites) { - actionGroup.add(new PredefinedValueAction("Favorites", favorites)); + actionGroup.add(new PredefinedValueAction("Favorites", favorites, false)); } private class BranchFilterAction extends PredefinedValueAction { @@ -128,7 +128,7 @@ public class BranchFilterPopupComponent extends MultipleValueFilterPopupComponen private boolean myIsFavorite; public BranchFilterAction(@NotNull String value, @NotNull Collection references) { - super(value, true); + super(value); myReferences = references; myIcon = new LayeredIcon(AllIcons.Nodes.Favorite, EmptyIcon.ICON_16); myHoveredIcon = new LayeredIcon(AllIcons.Nodes.FavoriteOnHover, AllIcons.Nodes.NotFavoriteOnHover); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/MultipleValueFilterPopupComponent.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/MultipleValueFilterPopupComponent.java index a72e48d8875f..3cb9325afb14 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/MultipleValueFilterPopupComponent.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/MultipleValueFilterPopupComponent.java @@ -104,23 +104,19 @@ abstract class MultipleValueFilterPopupComponent ex @NotNull protected final List myValues; private boolean myAddToRecent; - public PredefinedValueAction(@NotNull String value, boolean addToRecent) { - this(Collections.singletonList(value)); - myAddToRecent = addToRecent; - } - public PredefinedValueAction(@NotNull String value) { - this(value, true); + this(Collections.singletonList(value)); } public PredefinedValueAction(@NotNull List values) { - this(displayableText(values), values); + this(displayableText(values), values, true); } - public PredefinedValueAction(@NotNull String name, @NotNull List values) { + public PredefinedValueAction(@NotNull String name, @NotNull List values, boolean addToRecent) { super(null, tooltip(values), null); getTemplatePresentation().setText(name, false); myValues = values; + myAddToRecent = addToRecent; } @Override