package org.argeo.minidesktop;
+import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.file.Path;
throw new IllegalStateException("Already a display " + display);
display = new Display();
+ if (display.getTouchEnabled()) {
+ System.out.println("Touch enabled.");
+ }
+
images = new MiniDesktopImages(display);
int toolBarSize = 48;
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);
Color selectionBackground = display.getSystemColor(SWT.COLOR_LIST_SELECTION);
tabFolder.setSelectionBackground(selectionBackground);
-// tabFolder.setSelectionForeground(selectionBackground);
-// tabFolder.setSelectionBackground(
-// new Color[] { display.getSystemColor(SWT.COLOR_WHITE), display.getSystemColor(SWT.COLOR_BLUE) },
-// new int[] { 100 }, true);
// background
Control background = createBackground(tabFolder);
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();
}
+
+ long jvmUptime = ManagementFactory.getRuntimeMXBean().getUptime();
+ System.out.println("SWT Mini Desktop Manager available in " + jvmUptime + " ms.");
}
protected void createDock(ToolBar toolBar) {
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);
}
}
protected void initBackground(Composite backgroundArea) {
+ MiniHomePart homePart = new MiniHomePart() {
+
+ @Override
+ protected void fillAppsToolBar(ToolBar toolBar) {
+ createDock(toolBar);
+ }
+ };
+ homePart.createUiPart(backgroundArea, null);
}
public void run() {