mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs] Don't highlight commits due to unclear meaning
GitOrigin-RevId: 18e141ed65cdcf580be5f95ce8ed5e6730211e78
This commit is contained in:
committed by
intellij-monorepo-bot
parent
80b36e43f5
commit
0660d29ed3
+6
-16
@@ -71,7 +71,12 @@ abstract class MultipleCommitInfoDialog(private val project: Project, commits: L
|
||||
selected: Boolean,
|
||||
hasFocus: Boolean
|
||||
) {
|
||||
customizeListCellRenderer(list, value, index, selected, hasFocus)
|
||||
border = JBUI.Borders.empty()
|
||||
ipad = JBUI.insetsLeft(20)
|
||||
if (value != null) {
|
||||
append(value.subject)
|
||||
SpeedSearchUtil.applySpeedSearchHighlighting(commitsList, this, true, selected)
|
||||
}
|
||||
}
|
||||
}
|
||||
commitsList.selectionModel.addListSelectionListener { e ->
|
||||
@@ -98,21 +103,6 @@ abstract class MultipleCommitInfoDialog(private val project: Project, commits: L
|
||||
@Throws(VcsException::class)
|
||||
abstract fun loadChanges(commits: List<VcsCommitMetadata>): List<Change>
|
||||
|
||||
open fun ColoredListCellRenderer<VcsCommitMetadata>.customizeListCellRenderer(
|
||||
list: JList<out VcsCommitMetadata>,
|
||||
value: VcsCommitMetadata?,
|
||||
index: Int,
|
||||
selected: Boolean,
|
||||
hasFocus: Boolean
|
||||
) {
|
||||
border = JBUI.Borders.empty()
|
||||
ipad = JBUI.insetsLeft(20)
|
||||
if (value != null) {
|
||||
append(value.subject)
|
||||
SpeedSearchUtil.applySpeedSearchHighlighting(commitsList, this, true, selected)
|
||||
}
|
||||
}
|
||||
|
||||
fun setFilter(condition: (VcsCommitMetadata) -> Boolean) {
|
||||
val selectedCommits = commitsList.selectedValuesList.toSet()
|
||||
val model = commitsList.model as FilteringListModel<VcsCommitMetadata>
|
||||
|
||||
@@ -33,8 +33,6 @@ import com.intellij.openapi.vcs.changes.ui.ChangeListViewerDialog;
|
||||
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
|
||||
import com.intellij.openapi.vcs.merge.MergeDialogCustomizer;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.ColoredListCellRenderer;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.util.ExceptionUtil;
|
||||
import com.intellij.util.ThreeState;
|
||||
@@ -73,8 +71,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -594,8 +590,7 @@ public class GitRebaseProcess {
|
||||
"Collecting Commit Details...",
|
||||
true,
|
||||
project);
|
||||
DialogWrapper dlg = new MyMultipleCommitInfoDialog(project, root, details, filteredCommits,
|
||||
find(details, (commit) -> commit.getId().asString().equals(myUpstreamHash)));
|
||||
DialogWrapper dlg = new MyMultipleCommitInfoDialog(project, root, details, filteredCommits);
|
||||
dlg.setTitle(getRightTitle(false));
|
||||
dlg.show();
|
||||
return Unit.INSTANCE;
|
||||
@@ -614,29 +609,15 @@ public class GitRebaseProcess {
|
||||
@NotNull private final Project myProject;
|
||||
@NotNull private final VirtualFile myRoot;
|
||||
@NotNull private final Set<VcsCommitMetadata> myFilteredCommits;
|
||||
@NotNull private final Set<VcsCommitMetadata> myHighlightedCommits;
|
||||
@NotNull private static final JBColor UPSTREAM_COMMITS_BACKGROUND = new JBColor(new Color(228, 250, 255), new Color(63, 71, 73));
|
||||
|
||||
MyMultipleCommitInfoDialog(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull List<VcsCommitMetadata> commits,
|
||||
@NotNull Set<VcsCommitMetadata> filteredCommits,
|
||||
@Nullable VcsCommitMetadata baseCommit) {
|
||||
@NotNull Set<VcsCommitMetadata> filteredCommits) {
|
||||
super(project, commits);
|
||||
myProject = project;
|
||||
myRoot = root;
|
||||
myFilteredCommits = filteredCommits;
|
||||
|
||||
myHighlightedCommits = new HashSet<>();
|
||||
boolean highlighting = false;
|
||||
for (VcsCommitMetadata commit : commits) {
|
||||
if (commit.equals(baseCommit)) {
|
||||
highlighting = true;
|
||||
}
|
||||
if (highlighting) {
|
||||
myHighlightedCommits.add(commit);
|
||||
}
|
||||
}
|
||||
filterCommitsByConflictingFile();
|
||||
}
|
||||
|
||||
@@ -671,25 +652,6 @@ public class GitRebaseProcess {
|
||||
});
|
||||
return new BorderLayoutPanel().addToCenter(checkbox);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void customizeListCellRenderer(@NotNull ColoredListCellRenderer<VcsCommitMetadata> renderer,
|
||||
@NotNull JList<? extends VcsCommitMetadata> list,
|
||||
@Nullable VcsCommitMetadata value,
|
||||
int index,
|
||||
boolean selected,
|
||||
boolean hasFocus) {
|
||||
super.customizeListCellRenderer(renderer, list, value, index, selected, hasFocus);
|
||||
if (!selected) {
|
||||
if (myHighlightedCommits.contains(value)) {
|
||||
renderer.setBackground(UPSTREAM_COMMITS_BACKGROUND);
|
||||
}
|
||||
else {
|
||||
renderer.setBackground(list.getBackground());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user