From 4e047ed1d978a16f1b7dd2bbca76dbfa341f0b60 Mon Sep 17 00:00:00 2001 From: Michael Keppler Date: Sun, 19 Nov 2017 16:25:14 +0100 Subject: [PATCH] Better align repository hyperlink in commit viewer This removes the parent composite of the repository hyperlink label of the commit viewer toolbar. The improved layout is just because of not having the default spacing/margins/borders of the removed parent. Therefore an alternative fix would be to just set those layout properties instead of removing the composite, should some developer see this composite as necessary due to another reason unknown to me. Bug: 527454 Change-Id: I0694a04c43d92822e762f28d8b3b154ac53441f8 Signed-off-by: Michael Keppler --- .../src/org/eclipse/egit/ui/internal/commit/CommitEditor.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java index 4b2abbd2b..7d4bc9812 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java @@ -53,7 +53,6 @@ import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.ui.IEditorActionBarContributor; @@ -300,13 +299,9 @@ public class CommitEditor extends SharedHeaderFormEditor implements @Override protected Control createControl(Composite parent) { FormToolkit toolkit = getHeaderForm().getToolkit(); - Composite composite = toolkit.createComposite(parent); - RowLayout layout = new RowLayout(); - composite.setLayout(layout); - composite.setBackground(null); String label = getCommit().getRepositoryName(); - ImageHyperlink link = new ImageHyperlink(composite, SWT.NONE); + ImageHyperlink link = new ImageHyperlink(parent, SWT.NONE); // Focus tracking on this link doesn't really work. It's a // focusable control inside another focusable control (the // toolbar). When focus leaves this control through tabbing @@ -338,7 +333,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements } }); - return composite; + return link; } }; toolbar.add(repositoryLabelControl); -- 2.11.4.GIT