skin: manage a most recently used position
authorgiwoong.kim <giwoong.kim@samsung.com>
Wed, 22 May 2013 06:27:27 +0000 (15:27 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Wed, 22 May 2013 06:27:56 +0000 (15:27 +0900)
manage a most recently used position of docked KeyWindow

Change-Id: Ibe41b150b1e07ca98858fa042b146df691ff4c34
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java

index b683eb44b5b40d94a18e64e2e86d9a42dd804881..502abffd0a35d4c9f13602d96f6f6341f1f9df24 100644 (file)
@@ -423,16 +423,6 @@ public class EmulatorSkin {
                                                        screenShotDialog = null;
                                                }
 
-                                               /* close the Key Window */
-                                               if (skinInfo.isPhoneShape() == false) {
-                                                       closeKeyWindow();
-                                               }
-
-                                               /* dispose the color */
-                                               if (colorVM != null) {
-                                                       colorVM.dispose();
-                                               }
-
                                                /* save config only for emulator close */
                                                config.setSkinProperty(
                                                                SkinPropertiesConstants.WINDOW_X, shell.getLocation().x);
@@ -444,7 +434,25 @@ public class EmulatorSkin {
                                                                SkinPropertiesConstants.WINDOW_ROTATION, currentState.getCurrentRotationId());
                                                config.setSkinProperty(
                                                                SkinPropertiesConstants.WINDOW_ONTOP, Boolean.toString(isOnTop));
+
+                                               int dockValue = 0;
+                                               if (keyWindow != null && keyWindow.getShell().isVisible()) {
+                                                       dockValue = keyWindow.getDockPosition();
+                                               }
+                                               config.setSkinProperty(
+                                                               SkinPropertiesConstants.KEYWINDOW_POSITION, dockValue);
+
                                                config.saveSkinProperties();
+
+                                               /* close the Key Window */
+                                               if (skinInfo.isPhoneShape() == false) {
+                                                       closeKeyWindow();
+                                               }
+
+                                               /* dispose the color */
+                                               if (colorVM != null) {
+                                                       colorVM.dispose();
+                                               }
                                        }
 
                                        if (currentState.getCurrentImage() != null) {
index 3048bd42996ea6c72dad7987fe00294e58ed09d4..8bcd8ab3b8858c2c3a5a4a3184dec034afb2fde7 100644 (file)
@@ -89,7 +89,8 @@ public class EmulatorConfig {
                public static final String WINDOW_Y = "window.y";
                public static final String WINDOW_ROTATION = "window.rotate";
                public static final String WINDOW_SCALE = "window.scale";
-               public static final String WINDOW_ONTOP = "window.ontop"; // always on top
+               public static final String WINDOW_ONTOP = "window.ontop"; /* always on top */
+               public static final String KEYWINDOW_POSITION = "window.keywindow.position";
        }
 
        public interface ConfigPropertiesConstants {
index a4b8ce07caa2368ae5b375883b74c4c75a6c44ca..0060150c9c984648549f8e3327dc72de665b90eb 100644 (file)
@@ -204,10 +204,17 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                arrangeSkin(scale, rotationId);
 
                /* open the key window */
+               final int dockValue = config.getSkinPropertyInt(
+                               SkinPropertiesConstants.KEYWINDOW_POSITION, 0);
+
                shell.getDisplay().asyncExec(new Runnable() {
                        @Override
                        public void run() {
-                               skin.openKeyWindow(SWT.RIGHT | SWT.CENTER, false);
+                               if (dockValue == 0 || dockValue == SWT.NONE) {
+                                       skin.openKeyWindow(SWT.RIGHT | SWT.CENTER, false);
+                               } else {
+                                       skin.openKeyWindow(dockValue, false);
+                               }
                        }
                });
        }