[Title] move position of About dialog
authorgiwoong.kim <giwoong.kim@samsung.com>
Fri, 13 Apr 2012 10:41:45 +0000 (19:41 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Fri, 13 Apr 2012 10:41:45 +0000 (19:41 +0900)
[Type]
[Module] Emulator / menu
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/SkinDialog.java

index 44b9a96..063c595 100644 (file)
@@ -32,6 +32,7 @@ package org.tizen.emulator.skin.dialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -103,6 +104,16 @@ public abstract class SkinDialog extends Dialog {
                        return;
                }
 
+               if (this.parent != null) {
+                       Point central = new Point(
+                                       this.parent.getLocation().x + (this.parent.getSize().x / 2),
+                                       this.parent.getLocation().y + (this.parent.getSize().y / 2));
+
+                       shell.setLocation(
+                                       central.x - (shell.getSize().x / 2),
+                                       central.y - (shell.getSize().y / 2));
+               }
+
                shell.open();
 
                while ( !shell.isDisposed() ) {