Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.jface/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jface;singleton:=true
Bundle-Version: 3.38.100.qualifier
Bundle-Version: 3.38.200.qualifier

Check warning on line 5 in bundles/org.eclipse.jface/META-INF/MANIFEST.MF

View check run for this annotation

Jenkins - Eclipse Platform / API Tools

MINOR_VERSION_CHANGE_NO_NEW_API

ERROR: The service version is increased unnecessarily since either the major or minor or service version is already increased
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.jface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
Expand Down Expand Up @@ -296,4 +297,36 @@ private Image getSWTImage(final int imageID) {

}

@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
if (shouldRecomputeSizeOnDpiChange()) {
shell.addListener(SWT.ZoomChanged, e -> recomputeShellSize(shell));
}
}

/**
* Default behavior: recompute size based on current shell keep the maximum
* among the current bounds and the computed bounds
*
*/
private void recomputeShellSize(Shell shell) {
Point newSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
Rectangle currentBounds = shell.getBounds();
newSize.x = Math.max(currentBounds.width, newSize.x);
newSize.y = Math.max(currentBounds.height, newSize.y);
shell.setBounds(currentBounds.x, currentBounds.y, newSize.x, newSize.y);
}

/**
* This flag should be set to true if the size of this dialogue has to be
* recomputed on DPI change
*
* @return boolean
* @since 3.38
*/
public boolean shouldRecomputeSizeOnDpiChange() {
return false;
}

}
Loading