From: GiWoong Kim Date: Wed, 4 Sep 2013 08:35:54 +0000 (+0900) Subject: menu: change a parent of screenshot shell X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~776 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acdb0d70ee52e7e811665784af6c7bb22d4d613f;p=sdk%2Femulator%2Fqemu.git menu: change a parent of screenshot shell change a parent of screenshot shell and modified the init position Change-Id: Ia0b1e7d314d918d963815fe399de7564a40aab44 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/SkinDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/SkinDialog.java index 3b1d792569..a74b47d00e 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/SkinDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/SkinDialog.java @@ -127,7 +127,7 @@ public abstract class SkinDialog extends Dialog { if (y < monitorBounds.y) { y = monitorBounds.y; - } else if ((y + width) > (monitorBounds.y + monitorBounds.height)) { + } else if ((y + height) > (monitorBounds.y + monitorBounds.height)) { y = (monitorBounds.y + monitorBounds.height) - height; } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java index d2a8a85494..d1a5bc657b 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java @@ -117,8 +117,7 @@ public class ScreenShotDialog { this.config = config; this.scaleLevel = 100d; - shell = new Shell(Display.getDefault(), - SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX); + shell = new Shell(parent, SWT.SHELL_TRIM); shell.setText("Screen Shot - " + SkinUtil.makeEmulatorName(config)); /* To prevent the icon switching on Mac */ @@ -228,28 +227,33 @@ public class ScreenShotDialog { // } // }); - Rectangle monitorBound = Display.getDefault().getBounds(); - logger.info("host monitor display bound : " + monitorBound); - Rectangle emulatorBound = parent.getBounds(); - logger.info("current Emulator window bound : " + emulatorBound); - Rectangle dialogBound = shell.getBounds(); - logger.info("current ScreenShot Dialog bound : " + dialogBound); + Rectangle monitorBounds = Display.getDefault().getBounds(); + logger.info("host monitor display bounds : " + monitorBounds); + Rectangle emulatorBounds = parent.getBounds(); + logger.info("current Emulator window bounds : " + emulatorBounds); + Rectangle dialogBounds = shell.getBounds(); + logger.info("current ScreenShot Dialog bounds : " + dialogBounds); /* size correction */ - shell.setSize(emulatorBound.width, emulatorBound.height); - dialogBound = shell.getBounds(); - logger.info("current ScreenShot Dialog bound : " + dialogBound); + shell.setSize(emulatorBounds.width, emulatorBounds.height); + dialogBounds = shell.getBounds(); + logger.info("current ScreenShot Dialog bounds : " + dialogBounds); /* location correction */ - int x = emulatorBound.x + emulatorBound.width + 20; - int y = emulatorBound.y; - if ((x + dialogBound.width) > (monitorBound.x + monitorBound.width)) { - x = emulatorBound.x - dialogBound.width - 20; + int x = emulatorBounds.x + emulatorBounds.width + 20; + int y = emulatorBounds.y; + if ((x + dialogBounds.width) > (monitorBounds.x + monitorBounds.width)) { + x = emulatorBounds.x - dialogBounds.width - 20; + } + if (y < monitorBounds.y) { + y = monitorBounds.y; + } else if ((y + dialogBounds.height) > (monitorBounds.y + monitorBounds.height)) { + y = (monitorBounds.y + monitorBounds.height) - dialogBounds.height; } shell.setLocation(x, y); - dialogBound = shell.getBounds(); - logger.info("current ScreenShot Dialog bound : " + dialogBound); + dialogBounds = shell.getBounds(); + logger.info("current ScreenShot Dialog bounds : " + dialogBounds); } // private void drawRotatedImage( GC gc, int width, int height ) {