Using SWT.DEFAULT halves diff widget size computation again
For whatever reason, commentAndDiffComposite.computeSize() is faster if
both given size hints are SWT.DEFAULT.
Bug: 473013
Change-Id: I9e9dd6f17e8b2dc660d067abb65b470df8031f63
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
index 23e428c..9930a1c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
@@ -2028,17 +2028,8 @@
start = System.currentTimeMillis();
}
- int widthHint;
- if (commentViewer.getTextWidget().getWordWrap()) {
- widthHint = commentAndDiffScrolledComposite.getClientArea().width;
- if (commentAndDiffScrolledComposite.getVerticalBar() != null
- && !commentAndDiffScrolledComposite.getVerticalBar().isVisible())
- widthHint -= commentAndDiffScrolledComposite.getVerticalBar().getSize().x;
- } else {
- widthHint = SWT.DEFAULT;
- }
Point size = commentAndDiffComposite
- .computeSize(widthHint, SWT.DEFAULT);
+ .computeSize(SWT.DEFAULT, SWT.DEFAULT);
commentAndDiffScrolledComposite.setMinSize(size);
resizing = false;