You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2020/12/29 19:57:43 UTC
[incubator-hop] branch master updated: HOP-2361 Better layout for
AboutDialog
This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hop.git
The following commit(s) were added to refs/heads/master by this push:
new f772f5c HOP-2361 Better layout for AboutDialog
new 8c326e4 Merge pull request #508 from nadment/master
f772f5c is described below
commit f772f5ccfc0cbb5a2e197b72d22766545906966f
Author: nadment <na...@gmail.com>
AuthorDate: Tue Dec 29 13:18:13 2020 +0100
HOP-2361 Better layout for AboutDialog
---
.../apache/hop/ui/hopgui/dialog/AboutDialog.java | 60 ++++++++++------------
1 file changed, 26 insertions(+), 34 deletions(-)
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/dialog/AboutDialog.java b/ui/src/main/java/org/apache/hop/ui/hopgui/dialog/AboutDialog.java
index a8f551a..b7e6f78 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/dialog/AboutDialog.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/dialog/AboutDialog.java
@@ -47,7 +47,7 @@ import org.eclipse.swt.widgets.Text;
public class AboutDialog extends Dialog {
private static final Class<?> PKG = AboutDialog.class; // Needed by Translator
- private final String[] PROPERTIES = new String[] { "os.name","os.version","os.arch", "java.version", "java.vm.vendor", "java.specification.version","java.class.path","file.encoding","HOP_PLATFORM_RUNTIME","HOP_CONFIG_FOLDER"};
+ private static final String[] PROPERTIES = new String[] { "os.name","os.version","os.arch", "java.version", "java.vm.vendor", "java.specification.version","java.class.path","file.encoding","HOP_PLATFORM_RUNTIME","HOP_CONFIG_FOLDER"};
private Shell shell;
@@ -64,60 +64,51 @@ public class AboutDialog extends Dialog {
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.SHEET | SWT.RESIZE);
shell.setText(BaseMessages.getString(PKG, "AboutDialog.Title"));
shell.setImage(GuiResource.getInstance().getImageHopUi());
- shell.setSize(400, 400);
- shell.setMinimumSize(350, 250);
+ shell.setSize(700, 500);
+ shell.setMinimumSize(450, 300);
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
props.setLook(shell);
+
+ // Composite for logo, app name & version, and centering link
+ Composite composite = new Composite(shell, SWT.NONE);
+ FormData fdLink = new FormData();
+ fdLink.top = new FormAttachment(0, 0);
+ fdLink.left = new FormAttachment(0, 0);
+ fdLink.right = new FormAttachment(100, 0);
+ composite.setLayoutData(fdLink);
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 0;
+ composite.setLayout(gridLayout);
+ props.setLook(composite);
// Widget application logo
- Label wLogo = new Label(shell, SWT.CENTER);
+ Label wLogo = new Label(composite, SWT.CENTER);
wLogo.setImage(
SwtSvgImageUtil.getImageAsResource(display, "ui/images/logo_hop.svg")
.getAsBitmapForSize(display, 100, 100));
- FormData fdLogo = new FormData();
- fdLogo.top = new FormAttachment(0, 0);
- fdLogo.left = new FormAttachment(0, 0);
- wLogo.setLayoutData(fdLogo);
+ wLogo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 3));
// Widget application name
- Label wName = new Label(shell, SWT.CENTER);
+ Label wName = new Label(composite, SWT.CENTER);
wName.setText("Apache Hop\n(Incubating)");
- wName.setFont(GuiResource.getInstance().getFontLarge());
- FormData fdName = new FormData();
- fdName.top = new FormAttachment(0, 0);
- fdName.left = new FormAttachment(wLogo, 0);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ wName.setFont(GuiResource.getInstance().getFontBold());
+ wName.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
props.setLook(wName);
// Widget application version
- Label wVersion = new Label(shell, SWT.CENTER);
+ Label wVersion = new Label(composite, SWT.CENTER);
wVersion.setText(HopGui.class.getPackage().getImplementationVersion());
- FormData fdAppVersion = new FormData();
- fdAppVersion.top = new FormAttachment(wName, Const.MARGIN);
- fdAppVersion.left = new FormAttachment(wLogo, 0);
- fdAppVersion.right = new FormAttachment(100, 0);
- wVersion.setLayoutData(fdAppVersion);
+ wVersion.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
props.setLook(wVersion);
- // Widget link, use composite for centering
- Composite composite = new Composite(shell, SWT.NONE);
- FormData fdLink = new FormData();
- fdLink.top = new FormAttachment(wVersion, Const.MARGIN);
- fdLink.left = new FormAttachment(wLogo, 0);
- fdLink.right = new FormAttachment(100, 0);
- composite.setLayoutData(fdLink);
- composite.setLayout(new GridLayout(1, false));
- props.setLook(composite);
-
Link wLink = new Link(composite, SWT.WRAP | SWT.MULTI);
wLink.setText("<a href=\"https://hop.apache.org\">hop.apache.org</a>");
wLink.addListener(SWT.Selection, e -> Program.launch("https://hop.apache.org"));
- wLink.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
+ wLink.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
props.setLook(wLink);
// Buttons
@@ -127,10 +118,10 @@ public class AboutDialog extends Dialog {
BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk}, Const.MARGIN, null);
// Widget system properties
- Text wText = new Text(shell, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ Text wText = new Text(shell, SWT.READ_ONLY | SWT.WRAP | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
wText.setText(getProperties());
FormData fdText = new FormData();
- fdText.top = new FormAttachment(wLogo, Const.MARGIN);
+ fdText.top = new FormAttachment(composite, Const.MARGIN);
fdText.left = new FormAttachment(0, 0);
fdText.right = new FormAttachment(100, 0);
fdText.bottom = new FormAttachment(wOk, -Const.MARGIN);
@@ -140,6 +131,7 @@ public class AboutDialog extends Dialog {
// Detect [X] or ALT-F4 or something that kills this window...
shell.addShellListener(
new ShellAdapter() {
+ @Override
public void shellClosed(ShellEvent e) {
ok();
}