Author: mlytwyn
Date: Fri Mar 27 01:11:44 2015
New Revision: 38439

URL: http://svn.gna.org/viewcvs/gnustep?rev=38439&view=rev
Log:
Adjust modal window position to relative window requested

Modified:
    libs/gui/branches/gnustep_testplant_branch/Source/NSApplication.m

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSApplication.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSApplication.m?rev=38439&r1=38438&r2=38439&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSApplication.m   
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSApplication.m   Fri Mar 
27 01:11:44 2015
@@ -1977,8 +1977,19 @@
                relativeToWindow: (NSWindow *)docWindow
 {
   // FIXME
+  NSRect  frame = [docWindow frame];
+  NSPoint point = frame.origin;
+  NSSize  size  = [theWindow frame].size;
+  
+  // Calculate window position...
+  point.x += (frame.size.width - size.width) / 2;
+  point.y += (frame.size.height - size.height);
+
+  // Position window...
+  [theWindow setFrameOrigin:point];
   [theWindow orderWindow: NSWindowAbove
-            relativeTo: [docWindow windowNumber]];
+              relativeTo: [docWindow windowNumber]];
+  
   return [self runModalForWindow: theWindow];
 }
 


_______________________________________________
Gnustep-cvs mailing list
Gnustep-cvs@gna.org
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to