skin: The KeyWindow has extended its docking area
authorgiwoong.kim <giwoong.kim@samsung.com>
Wed, 22 May 2013 07:38:12 +0000 (16:38 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 23 May 2013 02:57:09 +0000 (11:57 +0900)
The KeyWindow has extended its docking area.

Change-Id: I8c3e7797bb18ffb547ecad5ba03534e239e61652
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/custom/KeyWindow.java
tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java

index ec5ee13b51a81024fa214544e2e33e1169c7ac4c..0c82feeb289523fb6f3c2513dbe2e99a6f42e523 100644 (file)
@@ -427,29 +427,53 @@ public class KeyWindow extends SkinWindow {
                                        Rectangle childBounds = shell.getBounds();
 
                                        int heightOneThird = parentBounds.height / 3;
+                                       int widthDockingArea = 30;
+                                       int widthIntersectRegion = 5;
 
                                        /* right-middle */
-                                       Rectangle attachBounds1 = new Rectangle(
-                                                       (parentBounds.x + parentBounds.width) - 5,
+                                       Rectangle attachBoundsRC = new Rectangle(
+                                                       (parentBounds.x + parentBounds.width) - widthIntersectRegion,
                                                        parentBounds.y + heightOneThird,
-                                                       30, heightOneThird);
+                                                       widthDockingArea, heightOneThird);
                                        /* right-top */
-                                       Rectangle attachBounds2 = new Rectangle(
-                                                       (parentBounds.x + parentBounds.width) - 5,
+                                       Rectangle attachBoundsRT = new Rectangle(
+                                                       (parentBounds.x + parentBounds.width) - widthIntersectRegion,
                                                        parentBounds.y,
-                                                       30, heightOneThird);
+                                                       widthDockingArea, heightOneThird);
                                        /* right-bottom */
-                                       Rectangle attachBounds3 = new Rectangle(
-                                                       (parentBounds.x + parentBounds.width) - 5,
+                                       Rectangle attachBoundsRB = new Rectangle(
+                                                       (parentBounds.x + parentBounds.width) - widthIntersectRegion,
                                                        parentBounds.y + (heightOneThird * 2),
-                                                       30, heightOneThird);
+                                                       widthDockingArea, heightOneThird);
 
-                                       if (childBounds.intersects(attachBounds1) == true) {
+                                       /* left-middle */
+                                       Rectangle attachBoundsLC = new Rectangle(
+                                                       parentBounds.x - (widthDockingArea - widthIntersectRegion),
+                                                       parentBounds.y + heightOneThird,
+                                                       widthDockingArea, heightOneThird);
+                                       /* left-top */
+                                       Rectangle attachBoundsLT = new Rectangle(
+                                                       parentBounds.x - (widthDockingArea - widthIntersectRegion),
+                                                       parentBounds.y,
+                                                       widthDockingArea, heightOneThird);
+                                       /* left-bottom */
+                                       Rectangle attachBoundsLB = new Rectangle(
+                                                       parentBounds.x - (widthDockingArea - widthIntersectRegion),
+                                                       parentBounds.y + (heightOneThird * 2),
+                                                       widthDockingArea, heightOneThird);
+
+                                       if (childBounds.intersects(attachBoundsRC) == true) {
                                                dock(SWT.RIGHT | SWT.CENTER, false, true);
-                                       } else if (childBounds.intersects(attachBounds2) == true) {
+                                       } else if (childBounds.intersects(attachBoundsRT) == true) {
                                                dock(SWT.RIGHT | SWT.TOP, false, true);
-                                       } else if (childBounds.intersects(attachBounds3) == true) {
+                                       } else if (childBounds.intersects(attachBoundsRB) == true) {
                                                dock(SWT.RIGHT | SWT.BOTTOM, false, true);
+                                       } else if (childBounds.intersects(attachBoundsLC) == true) {
+                                               dock(SWT.LEFT | SWT.CENTER, false, true);
+                                       } else if (childBounds.intersects(attachBoundsLT) == true) {
+                                               dock(SWT.LEFT | SWT.TOP, false, true);
+                                       } else if (childBounds.intersects(attachBoundsLB) == true) {
+                                               dock(SWT.LEFT | SWT.BOTTOM, false, true);
                                        } else {
                                                dock(SWT.NONE, false, true);
                                        }
index 19e08746aa4c67581ae49a9090e8a3274e5beef4..d7f2b5fc0e6ad83610393aa1d0781564cbeb9c24 100644 (file)
@@ -105,7 +105,19 @@ public class SkinWindow {
                                x += shift;
                                parent.setLocation(parentBounds.x + shift, parentBounds.y);
                        }*/
-               } else { /* SWT.RIGHT | SWT.CENTER */
+               }
+               else if (dockPosition == (SWT.LEFT | SWT.CENTER)) {
+                       x = parentBounds.x - childBounds.width;
+                       y = parentBounds.y + (parentBounds.height / 2) -
+                                       (childBounds.height / 2);
+               } else if (dockPosition == (SWT.LEFT | SWT.TOP)) {
+                       x = parentBounds.x - childBounds.width;
+                       y = parentBounds.y;
+               } else if (dockPosition == (SWT.LEFT | SWT.BOTTOM)) {
+                       x = parentBounds.x - childBounds.width;
+                       y = parentBounds.y + parentBounds.height - childBounds.height;
+               }
+               else { /* SWT.RIGHT | SWT.CENTER */
                        x = parentBounds.x + parentBounds.width;
                        y = parentBounds.y + (parentBounds.height / 2) -
                                        (childBounds.height / 2);
index 0060150c9c984648549f8e3327dc72de665b90eb..afc12f36ade21f220ac253d4d07fa6e96e3e20b5 100644 (file)
@@ -258,8 +258,8 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                }
 
                /* arrange the toggle button of key window */
-               toggleButton.setBounds(displayBounds.x + displayBounds.width,
-                               displayBounds.y + (displayBounds.height / 2) - (toggleButton.getImageSize().y / 2),
+               toggleButton.setBounds(displayBounds.x + displayBounds.width + 4,
+                               displayBounds.y + ((displayBounds.height - toggleButton.getImageSize().y) / 2),
                                toggleButton.getImageSize().x, toggleButton.getImageSize().y);
 
                /* arrange the progress bar */