diff --git a/macosx/URLSheetWindow.xib b/macosx/URLSheetWindow.xib index 5b4b3a88e..4577860e5 100644 --- a/macosx/URLSheetWindow.xib +++ b/macosx/URLSheetWindow.xib @@ -227,6 +227,14 @@ 21 + + + fCancelButton + + + + 22 + @@ -274,8 +282,8 @@ YES - + @@ -360,6 +368,7 @@ 6.IBPluginDependency 6.ImportedFromIB2 7.IBPluginDependency + 7.IBViewBoundsToFrameTransform 7.ImportedFromIB2 8.IBPluginDependency 8.ImportedFromIB2 @@ -371,9 +380,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{535, 596}, {400, 177}} + {{594, 582}, {400, 177}} com.apple.InterfaceBuilder.CocoaPlugin - {{535, 596}, {400, 177}} + {{594, 582}, {400, 177}} @@ -386,6 +395,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDmAAAwigAAA + com.apple.InterfaceBuilder.CocoaPlugin @@ -408,7 +420,7 @@ - 21 + 22 @@ -480,12 +492,14 @@ YES YES + fCancelButton fLabelField fOpenButton fTextField YES + NSButton NSTextField NSButton NSTextField @@ -495,12 +509,17 @@ YES YES + fCancelButton fLabelField fOpenButton fTextField YES + + fCancelButton + NSButton + fLabelField NSTextField diff --git a/macosx/URLSheetWindowController.h b/macosx/URLSheetWindowController.h index 8974035e6..abc9819bc 100644 --- a/macosx/URLSheetWindowController.h +++ b/macosx/URLSheetWindowController.h @@ -30,7 +30,7 @@ { IBOutlet NSTextField * fLabelField; IBOutlet NSTextField * fTextField; - IBOutlet NSButton * fOpenButton; + IBOutlet NSButton * fOpenButton, * fCancelButton; Controller * fController; } diff --git a/macosx/URLSheetWindowController.m b/macosx/URLSheetWindowController.m index 501f498fd..7714f674e 100644 --- a/macosx/URLSheetWindowController.m +++ b/macosx/URLSheetWindowController.m @@ -45,7 +45,31 @@ NSString * urlString = @""; [fTextField setStringValue: urlString]; [fTextField selectText: self]; - [fOpenButton setEnabled: ![urlString isEqualToString: @""]]; + [fOpenButton setTitle: NSLocalizedString(@"Open", "URL sheet button")]; + [fCancelButton setTitle: NSLocalizedString(@"Cancel", "URL sheet button")]; + + [fOpenButton sizeToFit]; + [fCancelButton sizeToFit]; + + //size the two buttons the same + NSRect openFrame = [fOpenButton frame]; + openFrame.size.width += 10.0; + NSRect cancelFrame = [fCancelButton frame]; + cancelFrame.size.width += 10.0; + + + + if (NSWidth(openFrame) > NSWidth(cancelFrame)) + cancelFrame.size.width = NSWidth(openFrame); + else + openFrame.size.width = NSWidth(cancelFrame); + + openFrame.origin.x = NSWidth([[self window] frame]) - NSWidth(openFrame) - 20.0 + 6.0; //I don't know why the extra 6.0 is needed + + [fOpenButton setFrame: openFrame]; + + cancelFrame.origin.x = NSMinX(openFrame) - NSWidth(cancelFrame); + [fCancelButton setFrame: cancelFrame]; } - (IBAction) beginSheetForWindow: (NSWindow *) window