From: giwoong.kim Date: Wed, 22 May 2013 07:38:12 +0000 (+0900) Subject: skin: The KeyWindow has extended its docking area X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~971 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e2e47122a6fabfdc395d0d14ae3858a8ef5b66f;p=sdk%2Femulator%2Fqemu.git skin: The KeyWindow has extended its docking area The KeyWindow has extended its docking area. Change-Id: I8c3e7797bb18ffb547ecad5ba03534e239e61652 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/KeyWindow.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/KeyWindow.java index ec5ee13b51..0c82feeb28 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/KeyWindow.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/KeyWindow.java @@ -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); } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java index 19e08746aa..d7f2b5fc0e 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SkinWindow.java @@ -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); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java index 0060150c9c..afc12f36ad 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java @@ -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 */