main window is now centered on the screen on first run

git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@390 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
angryziber 2008-04-12 14:07:30 +00:00
parent 4900c4ee56
commit bb7f8fa43a

View File

@ -14,6 +14,7 @@ import net.azib.ipscan.fetchers.PingFetcher;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
/**
* DimensionsConfig
@ -54,11 +55,12 @@ public class GUIConfig {
askScanConfirmation = preferences.getBoolean("askScanConfirmation", true);
isMainWindowMaximized = preferences.getBoolean("windowMaximized", false);
Rectangle screen = Display.getDefault().getBounds();
mainWindowBounds = new Rectangle(
preferences.getInt("windowLeft", 100),
preferences.getInt("windowTop", 100),
preferences.getInt("windowWidth", 600),
preferences.getInt("windowHeight", 360));
preferences.getInt("windowLeft", screen.x + screen.width/2 - 660/2),
preferences.getInt("windowTop", screen.y + screen.height/2 - 380/2),
preferences.getInt("windowWidth", 660),
preferences.getInt("windowHeight", 380));
detailsWindowSize = new Point(
preferences.getInt("detailsWidth", 300),