Author: fredkiefer
Date: Fri Mar 27 22:33:24 2015
New Revision: 38440

URL: http://svn.gna.org/viewcvs/gnustep?rev=38440&view=rev
Log:
        * Source/NSSavePanel.m: Fix problem with the title shown in
        the save panel's title bar not matching the set title when
        the panel is reused for a different purpose.
        Patch by Doug Simons <[email protected]>
        * Source/NSApplication.m: Adjust modal window position to
        relative window requested.
        Patch by Marcian Lytwyn <[email protected]> with small change.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/NSApplication.m
    libs/gui/trunk/Source/NSSavePanel.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38440&r1=38439&r2=38440&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Fri Mar 27 22:33:24 2015
@@ -1,3 +1,13 @@
+2015-03-27 Fred Kiefer <[email protected]>
+
+       * Source/NSSavePanel.m: Fix problem with the title shown in
+       the save panel's title bar not matching the set title when
+       the panel is reused for a different purpose.
+       Patch by Doug Simons <[email protected]>
+       * Source/NSApplication.m: Adjust modal window position to relative
+       window requested.
+       Patch by Marcian Lytwyn <[email protected]> with small change.
+
 2015-03-16 Fred Kiefer <[email protected]>
 
        * Images/NSRemoveTemplate.tiff: Add file.

Modified: libs/gui/trunk/Source/NSApplication.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSApplication.m?rev=38440&r1=38439&r2=38440&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSApplication.m       (original)
+++ libs/gui/trunk/Source/NSApplication.m       Fri Mar 27 22:33:24 2015
@@ -1969,13 +1969,26 @@
  * Put up a modal window centered relative to docWindow.  On OS X this is
  * deprecated in favor of
  * -beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: .
- * <em>Not implemented under GNUstep.  Currently just centers window on the
- * screen.</em>
  */
 - (NSInteger) runModalForWindow: (NSWindow *)theWindow
                relativeToWindow: (NSWindow *)docWindow
 {
-  // FIXME
+  if ((docWindow != nil) && (theWindow != nil))
+    {
+      NSRect  docFrame = [docWindow frame];
+      NSPoint point = docFrame.origin;
+      NSRect  theFrame = [theWindow frame];
+      NSSize  size  = theFrame.size;
+  
+      // Calculate window position...
+      point.x += (docFrame.size.width - size.width) / 2;
+      point.y += (docFrame.size.height - size.height) / 2;
+
+      NSDebugLLog(@"NSWindow", @"Positioning window %@ relative to %@ at %@", 
+            NSStringFromRect(theFrame), NSStringFromRect(docFrame), 
NSStringFromPoint(point));
+      // Position window...
+      [theWindow setFrameOrigin: point];
+    }
   [theWindow orderWindow: NSWindowAbove
             relativeTo: [docWindow windowNumber]];
   return [self runModalForWindow: theWindow];

Modified: libs/gui/trunk/Source/NSSavePanel.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSSavePanel.m?rev=38440&r1=38439&r2=38440&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSSavePanel.m (original)
+++ libs/gui/trunk/Source/NSSavePanel.m Fri Mar 27 22:33:24 2015
@@ -859,6 +859,8 @@
 */
 - (void) setTitle: (NSString*)title
 {
+  // keep the window title in sync with the title field
+  [super setTitle:title];
   [_titleField setStringValue: title];
 
   // TODO: Improve the following by managing 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to