Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Webster2012-04-03 15:45:49 +0000
committerPaul Webster2012-04-03 15:45:49 +0000
commit7a8e3037f3cdd6ced184f780c6b9e01ab2ce1bab (patch)
tree55f12eea6c799f10e1c02b1be0ee758f04290f0e
parent95ad26b62985b640e8b98cebc7950ea7244dca38 (diff)
downloadeclipse.platform.ui-7a8e3037f3cdd6ced184f780c6b9e01ab2ce1bab.tar.gz
eclipse.platform.ui-7a8e3037f3cdd6ced184f780c6b9e01ab2ce1bab.tar.xz
eclipse.platform.ui-7a8e3037f3cdd6ced184f780c6b9e01ab2ce1bab.zip
Bug 242144 - [Progress] Progress view does not shrink
If there is no progress bar, the FormDatas should be similar to those in setLayoutsForNoProgress(). When the progress bar shows up, the layout data needs to be changed and the Composite needs to re-layout Bug: 242144
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
index 8a7a121b45f..d3e63749f23 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
@@ -495,6 +495,7 @@ public class ProgressInfoItem extends Composite {
jobImageLabel.setImage(getInfoImage());
int percentDone = getPercentDone();
+ ProgressBar currentProgressBar = progressBar;
JobInfo[] infos = getJobInfos();
if (isRunning()) {
@@ -590,6 +591,10 @@ public class ProgressInfoItem extends Composite {
updateToolBarValues();
setMainText();
+
+ if (currentProgressBar != progressBar) {
+ getParent().layout(new Control[] { this });
+ }
}
/**
@@ -724,8 +729,7 @@ public class ProgressInfoItem extends Composite {
FormData linkData = new FormData();
linkData.top = new FormAttachment(progressBar,
IDialogConstants.VERTICAL_SPACING);
- linkData.left = new FormAttachment(0,
- IDialogConstants.HORIZONTAL_SPACING);
+ linkData.left = new FormAttachment(progressBar, 0, SWT.LEFT);
linkData.right = new FormAttachment(progressBar, 0, SWT.RIGHT);
// Give an initial value so as to constrain the link shortening
linkData.width = IDialogConstants.INDENT;
@@ -753,7 +757,7 @@ public class ProgressInfoItem extends Composite {
linkData.top = new FormAttachment(top,
IDialogConstants.VERTICAL_SPACING);
linkData.left = new FormAttachment(top, 0, SWT.LEFT);
- linkData.right = new FormAttachment(progressBar, 0, SWT.RIGHT);
+ linkData.right = new FormAttachment(top, 0, SWT.RIGHT);
// Give an initial value so as to constrain the link shortening
linkData.width = IDialogConstants.INDENT;
} else {

Back to the top