]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - rcp/org.argeo.minidesktop/src/org/argeo/minidesktop/MiniDesktopManager.java
Various improvements to Mini Desktop after testing on Windows.
[gpl/argeo-slc.git] / rcp / org.argeo.minidesktop / src / org / argeo / minidesktop / MiniDesktopManager.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);
                }