]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Various improvements to Mini Desktop after testing on Windows.
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 25 Apr 2020 07:53:29 +0000 (09:53 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 25 Apr 2020 07:53:29 +0000 (09:53 +0200)
rcp/org.argeo.minidesktop/src/org/argeo/minidesktop/MiniDesktopManager.java
rcp/org.argeo.minidesktop/src/org/argeo/minidesktop/MiniHomePart.java

index ba2e48032cab094b255de3cdc171acad2b839039..4d7c03c62c0dc614ca14539ba5c83d28b3a6e53b 100644 (file)
@@ -64,6 +64,7 @@ public class MiniDesktopManager {
                        rootShell = new Shell(display, SWT.NO_TRIM);
                        rootShell.setFullScreen(true);
                        Rectangle bounds = display.getBounds();
+                       rootShell.setLocation(0, 0);
                        rootShell.setSize(bounds.width, bounds.height);
                } else {
                        rootShell = new Shell(display, SWT.CLOSE | SWT.RESIZE);
@@ -106,17 +107,15 @@ public class MiniDesktopManager {
                        homeTabItem.setControl(background);
                        tabFolder.setFocus();
                } else {
-                       if (isFullscreen())
-                               createBackground(rootShell);
-                       else
-                               rootShell.pack();
+                       createBackground(rootShell);
                }
 
                rootShell.open();
                // rootShell.layout(true, true);
 
                if (toolBarShell != null) {
-                       toolBarShell.setLocation(new Point(0, 0));
+                       int toolBarShellY = (display.getBounds().height - toolBar.getSize().y) / 2;
+                       toolBarShell.setLocation(0, toolBarShellY);
                        toolBarShell.open();
                }
        }
@@ -224,7 +223,8 @@ public class MiniDesktopManager {
                        item.setControl(appParent);
                        return new AppContext(item);
                } else {
-                       Shell shell = new Shell(rootShell.getDisplay(), SWT.SHELL_TRIM);
+                       Shell shell = isFullscreen() ? new Shell(rootShell, SWT.SHELL_TRIM)
+                                       : new Shell(rootShell.getDisplay(), SWT.SHELL_TRIM);
                        shell.setImage(icon);
                        return new AppContext(shell);
                }
index b2ee6c1bc3b29db4460815578d0257cf7615fa65..877f643842e7dcf797c694b22e0fe78fdff860bb 100644 (file)
@@ -58,16 +58,20 @@ public class MiniHomePart {
                if (netInterfaces != null)
                        while (netInterfaces.hasMoreElements()) {
                                NetworkInterface netInterface = netInterfaces.nextElement();
+                               byte[] hardwareAddress = null;
                                try {
-                                       label(hostGroup, convertHardwareAddress(netInterface.getHardwareAddress()));
+                                       hardwareAddress = netInterface.getHardwareAddress();
+                                       if (hardwareAddress != null) {
+                                               label(hostGroup, convertHardwareAddress(hardwareAddress));
+                                               label(hostGroup, netInterface.getName());
+                                               for (InterfaceAddress addr : netInterface.getInterfaceAddresses()) {
+                                                       label(hostGroup, cleanHostAddress(addr.getAddress().getHostAddress()));
+                                                       label(hostGroup, Short.toString(addr.getNetworkPrefixLength()));
+                                               }
+                                       }
                                } catch (SocketException e) {
                                        label(hostGroup, e.getMessage());
                                }
-                               label(hostGroup, netInterface.getName());
-                               for (InterfaceAddress addr : netInterface.getInterfaceAddresses()) {
-                                       label(hostGroup, cleanHostAddress(addr.getAddress().getHostAddress()));
-                                       label(hostGroup, Short.toString(addr.getNetworkPrefixLength()));
-                               }
                        }
 
                // Resources