Skip to content

Commit

Permalink
About image dispose fix
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Sep 17, 2024
1 parent 58f87ed commit 1fc1266
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,11 @@ public class AboutBoxDialog extends InformationDialog
public static final String PRODUCT_PROP_SUB_TITLE = "subTitle"; //$NON-NLS-1$
public static final String PRODUCT_PROP_COPYRIGHT = "copyright"; //$NON-NLS-1$
public static final String PRODUCT_PROP_WEBSITE = "website"; //$NON-NLS-1$
public static final String PRODUCT_PROP_EMAIL = "email"; //$NON-NLS-1$
//public static final String PRODUCT_PROP_EMAIL = "email"; //$NON-NLS-1$

private final Font NAME_FONT,TITLE_FONT;
private static final Log log = Log.getLog(AboutBoxDialog.class);

private Image ABOUT_IMAGE = AbstractUIPlugin.imageDescriptorFromPlugin(
Platform.getProduct().getDefiningBundle().getSymbolicName(),
"icons/dbeaver_about.png").createImage();
private Image splashImage;

public AboutBoxDialog(Shell shell)
Expand Down Expand Up @@ -105,12 +102,6 @@ protected void configureShell(Shell newShell) {
newShell.setText(CoreMessages.dialog_about_title);
}

@Override
protected boolean isResizable()
{
return true;
}

@Override
protected Control createDialogArea(Composite parent)
{
Expand Down Expand Up @@ -193,7 +184,12 @@ public void run() {
}

{
final Image image = splashImage != null ? splashImage : ABOUT_IMAGE;
Image aboutImage = AbstractUIPlugin.imageDescriptorFromPlugin(
Platform.getProduct().getDefiningBundle().getSymbolicName(),
"icons/dbeaver_about.png").createImage();
parent.addDisposeListener(e -> aboutImage.dispose());

final Image image = splashImage != null ? splashImage : aboutImage;
final Canvas canvas = new Canvas(group, SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND) {
@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
Expand All @@ -209,7 +205,7 @@ public Point computeSize(int wHint, int hHint, boolean changed) {
Text versionLabel = new Text(group, SWT.NONE);
versionLabel.setEditable(false);
versionLabel.setBackground(background);
versionLabel.setText(CoreMessages.dialog_about_label_version + GeneralUtils.getProductVersion().toString());
versionLabel.setText(CoreMessages.dialog_about_label_version + GeneralUtils.getProductVersion());
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalAlignment = GridData.CENTER;
versionLabel.setLayoutData(gd);
Expand Down

0 comments on commit 1fc1266

Please sign in to comment.