skin: save most recently dock position
authorgiwoong.kim <giwoong.kim@samsung.com>
Mon, 14 Jan 2013 11:30:47 +0000 (20:30 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Mon, 14 Jan 2013 12:01:59 +0000 (21:01 +0900)
save most recently dock position when disable the
popup menu item of key window.

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/layout/GeneralPurposeSkinComposer.java

index 265937a33b1ab07e371f769436308877768dd556..8bd77213d27024fc4106318c039481d9839cb96d 100644 (file)
@@ -145,6 +145,7 @@ public class EmulatorSkin {
        private Menu contextMenu;
        private MenuItem keyWindowItem; /* key window menu */
        public KeyWindow keyWindow;
+       public int recentlyDocked;
        public Color colorPairTag;
        public Canvas pairTagCanvas;
        public CustomProgressBar bootingProgress;
@@ -188,6 +189,7 @@ public class EmulatorSkin {
 
                this.isOnTop = isOnTop;
                this.isKeyWindow = false;
+               this.recentlyDocked = SWT.NONE;
 
                int style = SWT.NO_TRIM | SWT.DOUBLE_BUFFERED;
 //             if (skinInfo.isPhoneShape() == false) {
@@ -1093,7 +1095,8 @@ public class EmulatorSkin {
 
                                if (selectKeyWindow == true) {
                                        if (keyWindow == null) {
-                                               openKeyWindow(SWT.RIGHT | SWT.CENTER, false);
+                                               openKeyWindow(recentlyDocked, false);
+                                               recentlyDocked = SWT.NONE;
                                        } else {
                                                openKeyWindow(keyWindow.getDockPosition(), false);
                                        }
@@ -1101,6 +1104,7 @@ public class EmulatorSkin {
                                        if (keyWindow != null &&
                                                        keyWindow.getDockPosition() != SWT.NONE) {
                                                /* close the Key Window if it is docked to Main Window */
+                                               recentlyDocked = keyWindow.getDockPosition();
                                                closeKeyWindow();
                                        } else {
                                                hideKeyWindow();
index 86f461be9b928200e10133b9f45304671ff55c2d..295cfaaa9d5bebc8eea5c5d3bcde71c9e973c89e 100644 (file)
@@ -159,6 +159,7 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                        public void mouseDown(MouseEvent e) {
                                if (skin.isSelectKeyWindow() == true) {
                                        skin.closeKeyWindow();
+                                       skin.recentlyDocked = SWT.RIGHT | SWT.CENTER;
                                } else {
                                        skin.openKeyWindow(SWT.RIGHT | SWT.CENTER, true);
                                }