diff options
author | Michael Rennie | 2009-12-01 16:27:18 +0000 |
---|---|---|
committer | Michael Rennie | 2009-12-01 16:27:18 +0000 |
commit | 2f36c58e13e7a447a21d5a4e8e80c686faedc37c (patch) | |
tree | aaca67e76b1ece5e1e5ae07207aa3ab41b1147b0 | |
parent | 5ee31ed55ca0a3720552e04ab1091e460a20507f (diff) | |
download | eclipse.platform.debug-2f36c58e13e7a447a21d5a4e8e80c686faedc37c.tar.gz eclipse.platform.debug-2f36c58e13e7a447a21d5a4e8e80c686faedc37c.tar.xz eclipse.platform.debug-2f36c58e13e7a447a21d5a4e8e80c686faedc37c.zip |
Bug 282308 - [launching] Launch configuration dialog resizes willy-nilly to my frustration
2 files changed, 30 insertions, 3 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java index 0a8be569a..0da0427f2 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java @@ -94,6 +94,14 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia } /* (non-Javadoc) + * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#initializeBounds() + */ + protected void initializeBounds() { + super.initializeBounds(); + resize(); + } + + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#initializeContent() */ protected void initializeContent() { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java index 05029e6e5..5bced3e76 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java @@ -120,7 +120,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun * Constant specifying how tall this dialog is allowed to get (as a percentage of * total available screen height) as a result of preferred tab size. */ - protected static final float MAX_DIALOG_HEIGHT_PERCENT = 0.60f; + protected static final float MAX_DIALOG_HEIGHT_PERCENT = 0.65f; /** * Size of this dialog if there is no preference specifying a size. */ @@ -925,9 +925,12 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun fTabViewer.handleApplyPressed(); } } + if(getShell() != null && getShell().isVisible()) { + resize(); + } } } - + /** * Notification the 'launch' button has been pressed. * Save and launch. @@ -1173,7 +1176,23 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun updateButtons(); } - + /** + * resize the dialog to show all relevant content + */ + protected void resize() { + if(getTabGroup() != null) { + Point shell = getShell().getSize(); + int maxx = (int)(getDisplay().getBounds().width * MAX_DIALOG_WIDTH_PERCENT), + maxy = (int) (getDisplay().getBounds().height * MAX_DIALOG_HEIGHT_PERCENT); + maxx = (maxx < DEFAULT_INITIAL_DIALOG_SIZE.x ? DEFAULT_INITIAL_DIALOG_SIZE.x : maxx); + maxy = (maxy < DEFAULT_INITIAL_DIALOG_SIZE.y ? DEFAULT_INITIAL_DIALOG_SIZE.y : maxy); + Point psize = getShell().computeSize(SWT.DEFAULT, maxy); + if((psize.x > maxx ? maxx : psize.x) > shell.x || (psize.y > maxy ? maxy : psize.y) > shell.y) { + setShellSize(Math.min(psize.x, maxx), Math.min(psize.y, maxy)); + constrainShellSize(); + } + } + } /* (non-Javadoc) * @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress) |