IDEA-76525 Git: "Branch not fully merged" dialog layout
authorKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Mon, 30 Jan 2012 09:29:24 +0000 (13:29 +0400)
committerKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Mon, 30 Jan 2012 09:29:24 +0000 (13:29 +0400)
plugins/git4idea/src/git4idea/ui/GitCommitListWithDiffPanel.java

index 9616c7740db8862ee0e9d740f3363645f959c618..098c21c8302f30ac9354973311ffdf5d3ab0d6cd 100644 (file)
@@ -24,6 +24,7 @@ import git4idea.history.browser.GitCommit;
 import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
+import java.awt.*;
 import java.util.Collections;
 import java.util.List;
 
@@ -35,24 +36,24 @@ import java.util.List;
  */
 public class GitCommitListWithDiffPanel extends JPanel {
 
-  private final Project myProject;
   private final ChangesBrowser myChangesBrowser;
   private final GitCommitListPanel myCommitListPanel;
 
-  public GitCommitListWithDiffPanel(Project project, List<GitCommit> commits) {
-    myProject = project;
+  public GitCommitListWithDiffPanel(@NotNull Project project, @NotNull List<GitCommit> commits) {
+    super(new BorderLayout());
 
-    myCommitListPanel = new GitCommitListPanel(myProject, commits);
+    myCommitListPanel = new GitCommitListPanel(project, commits);
     myCommitListPanel.addListSelectionListener(new Consumer<GitCommit>() {
       @Override public void consume(GitCommit commit) {
         myChangesBrowser.setChangesToDisplay(commit.getChanges());
       }
     });
 
-    myChangesBrowser = new ChangesBrowser(myProject, null, Collections.<Change>emptyList(), null, false, true, null, ChangesBrowser.MyUseCase.LOCAL_CHANGES, null);
+    myChangesBrowser = new ChangesBrowser(project, null, Collections.<Change>emptyList(), null, false, true, null, ChangesBrowser.MyUseCase.LOCAL_CHANGES, null);
     myCommitListPanel.registerDiffAction(myChangesBrowser.getDiffAction());
 
     Splitter splitter = new Splitter(false, 0.7f);
+    splitter.setHonorComponentsMinimumSize(false);
     splitter.setFirstComponent(myCommitListPanel);
     splitter.setSecondComponent(myChangesBrowser);
     add(splitter);