diff --git a/TODO.md b/TODO.md index 211df6cf..ca25bd5b 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,3 @@ -HiDPI: -* New flat and retina-compatible icons :-) -* Scan complete Close button is partly outside of the window - * Remember InfoDialog size * Add URLFetcher with configurable URL and JSON/XPath expression diff --git a/src/net/azib/ipscan/gui/InfoDialog.java b/src/net/azib/ipscan/gui/InfoDialog.java index 48ca1aa7..8a50609e 100644 --- a/src/net/azib/ipscan/gui/InfoDialog.java +++ b/src/net/azib/ipscan/gui/InfoDialog.java @@ -6,7 +6,6 @@ package net.azib.ipscan.gui; -import net.azib.ipscan.gui.util.LayoutHelper; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; @@ -17,9 +16,9 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import static net.azib.ipscan.gui.util.LayoutHelper.formData; +import static net.azib.ipscan.gui.util.LayoutHelper.formLayout; public class InfoDialog extends AbstractModalDialog { - String title; String title2; String message; @@ -32,7 +31,7 @@ public class InfoDialog extends AbstractModalDialog { @Override protected void populateShell() { shell.setText(title); - shell.setLayout(LayoutHelper.formLayout(10, 10, 15)); + shell.setLayout(formLayout(10, 10, 15)); Label iconLabel = new Label(shell, SWT.ICON); iconLabel.setLayoutData(formData(new FormAttachment(0), null, new FormAttachment(0), null)); @@ -44,16 +43,16 @@ public class InfoDialog extends AbstractModalDialog { titleLabel.setFont(new Font(null, sysFontData.getName(), sysFontData.getHeight()+3, sysFontData.getStyle() | SWT.BOLD)); titleLabel.setText(title2); - Button button = createCloseButton(); - Text statsText = new Text(shell, SWT.MULTI | SWT.READ_ONLY); statsText.setBackground(shell.getBackground()); statsText.setLayoutData(formData(new FormAttachment(iconLabel), new FormAttachment(100, -20), new FormAttachment(titleLabel), null)); statsText.setText(message); statsText.pack(); + Button button = createCloseButton(); + Point buttonSize = button.getSize(); - button.setLayoutData(formData(buttonSize.x, buttonSize.y, null, new FormAttachment(100), new FormAttachment(statsText), null)); + button.setLayoutData(formData(buttonSize.x, buttonSize.y, null, new FormAttachment(100), new FormAttachment(statsText, 10), null)); shell.pack(); }