From: giwoong.kim Date: Thu, 17 May 2012 11:06:39 +0000 (+0900) Subject: [Title] screenshot window size correction X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1594^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8649e61ca676ee8c2eb88bc696dce00336ed9fa5;p=sdk%2Femulator%2Fqemu.git [Title] screenshot window size correction [Type] enhancement [Module] Emulator / skin [Priority] [Jira#] [Redmine#] 4910 [Problem] [Cause] [Solution] [TestCase] --- 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 e9714f0f4d..84d353a5c2 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 @@ -59,6 +59,7 @@ import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.ToolBar; @@ -97,6 +98,7 @@ public class ScreenShotDialog { private Canvas imageCanvas; private Shell shell; private ScrolledComposite scrollComposite; + private Label label; private SocketCommunicator communicator; private EmulatorSkin emulatorSkin; @@ -177,16 +179,31 @@ public class ScreenShotDialog { throw e; } + label = new Label(shell, SWT.BORDER); + shell.pack(); - Rectangle monitorBound = Display.getDefault().getBounds(); - logger.info("current display size : " + monitorBound); - int x = parent.getLocation().x + parent.getSize().x + 20; - int y = parent.getLocation().y; - if ((x + shell.getSize().x) > (monitorBound.x + monitorBound.width)) { - x = parent.getLocation().x - shell.getSize().x - 20; + 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); + + /* size correction */ + shell.setSize(emulatorBound.width, emulatorBound.height); + dialogBound = shell.getBounds(); + logger.info("current ScreenShot Dialog bound : " + dialogBound); + + /* 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; } shell.setLocation(x, y); + dialogBound = shell.getBounds(); + logger.info("current ScreenShot Dialog bound : " + dialogBound); }