From 3d002ac1a9887286aa96d5ec1e310d23d8b34399 Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Sat, 15 Oct 2011 10:40:47 +0200 Subject: [PATCH] add some alignment to revisions --- .../src/git4idea/checkin/GitPushActiveBranchesDialog.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java b/plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java index 12af599a4854..99c3a8bbc8b4 100644 --- a/plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java +++ b/plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java @@ -51,7 +51,6 @@ import git4idea.actions.GitShowAllSubmittedFilesAction; import git4idea.commands.*; import git4idea.config.GitVcsSettings; import git4idea.i18n.GitBundle; -import git4idea.update.GitComplexProcess; import git4idea.rebase.GitRebaser; import git4idea.repo.GitRepository; import git4idea.repo.GitRepositoryManager; @@ -59,6 +58,7 @@ import git4idea.stash.GitChangesSaver; import git4idea.stash.GitShelveChangesSaver; import git4idea.stash.GitStashChangesSaver; import git4idea.ui.GitUIUtil; +import git4idea.update.GitComplexProcess; import git4idea.update.GitUpdateProcess; import git4idea.update.UpdatePolicyUtils; import org.jetbrains.annotations.NotNull; @@ -1019,7 +1019,9 @@ public class GitPushActiveBranchesDialog extends DialogWrapper { @Override protected void render(ColoredTreeCellRenderer renderer) { - renderer.append(revision.asString().substring(0, HASH_PREFIX_SIZE), SimpleTextAttributes.GRAYED_ATTRIBUTES); + final String shortRevision = revision.asString().substring(0, HASH_PREFIX_SIZE); + renderer.append(shortRevision, SimpleTextAttributes.GRAYED_ATTRIBUTES); + renderer.appendAlign(renderer.getFontMetrics(renderer.getFont()).stringWidth(StringUtil.repeat("8", HASH_PREFIX_SIZE))); renderer.append(": "); renderer.append(message); if (isMerge) {