From: giwoong.kim Date: Mon, 16 Apr 2012 06:03:17 +0000 (+0900) Subject: [Title] Monitor size should be considered when determining the dialog location X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1631 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e270ba93e8863d147f18dac909022354fc6c82f;p=sdk%2Femulator%2Fqemu.git [Title] Monitor size should be considered when determining the dialog location [Type] enhancement [Module] Emulator / screenshot [Priority] [Jira#] [Redmine#] [Problem] [Cause] resolution [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 a0b232411b..6b131b4e32 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 @@ -52,6 +52,7 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.ImageLoader; import org.eclipse.swt.graphics.PaletteData; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Canvas; @@ -115,7 +116,6 @@ public class ScreenShotDialog { shell = new Shell( Display.getDefault(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX ); shell.setText( "Screen Shot - " + SkinUtil.makeEmulatorName( config ) ); - shell.setLocation( parent.getLocation().x + parent.getSize().x + 30, parent.getLocation().y ); shell.addListener( SWT.Close, new Listener() { @Override public void handleEvent( Event event ) { @@ -175,6 +175,15 @@ public class ScreenShotDialog { 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; + } + shell.setLocation(x, y); + } // private void drawRotatedImage( GC gc, int width, int height ) { @@ -573,4 +582,4 @@ public class ScreenShotDialog { return shell; } -} \ No newline at end of file +}