File->Close sends performClose:

This fixes a bug where <D-w> would close not close the about dialog box,
but instead would close a (partially) obscured window.
This commit is contained in:
Bjorn Winckler
2008-01-29 20:05:21 +01:00
parent d2b63e9e8f
commit 112f86ba33
5 changed files with 28 additions and 4 deletions
+9 -3
View File
@@ -214,14 +214,20 @@ static int numFullscreenWindows = 0;
[view setFrameOrigin:origin];
}
#pragma mark Proxy/Decorator/whatever stuff
- (void)scrollWheel:(NSEvent *)theEvent
{
[[view textView] scrollWheel:theEvent];
}
- (void)performClose:(id)sender
{
id wc = [self windowController];
if ([wc respondsToSelector:@selector(performClose:)])
[wc performClose:sender];
else
[super performClose:sender];
}
@end // MMFullscreenWindow
+9
View File
@@ -117,4 +117,13 @@
[super setContentSize:size];
}
- (void)performClose:(id)sender
{
id wc = [self windowController];
if ([wc respondsToSelector:@selector(performClose:)])
[wc performClose:sender];
else
[super performClose:sender];
}
@end // MMWindow
+1
View File
@@ -65,5 +65,6 @@
- (IBAction)addNewTab:(id)sender;
- (IBAction)toggleToolbar:(id)sender;
- (IBAction)performClose:(id)sender;
@end
+8
View File
@@ -606,6 +606,14 @@
[vimController sendMessage:ToggleToolbarMsgID data:nil];
}
- (IBAction)performClose:(id)sender
{
// NOTE: File->Close is bound to this action message instead binding it
// directly to the below vim input so that File->Close also works for
// auxiliary windows such as the About dialog. (If we were to bind the
// below, then <D-w> will not close e.g. the About dialog.)
[vimController addVimInput:@"<C-\\><C-N>:conf q<CR>"];
}
// -- NSWindow delegate ------------------------------------------------------
+1 -1
View File
@@ -47,7 +47,7 @@ an 10.295 File.New\ Tab :tabnew<CR>
an <silent> 10.310 File.&Open\.\.\. :maca fileOpen:<CR>
an 10.328 File.-SEP0- <Nop>
an <silent> 10.330 File.Close\ Window<Tab>:qa :confirm qa<CR>
an 10.331 File.Close<Tab>:q :confirm q<CR>
an <silent> 10.331 File.Close :maca performClose:<CR>
"an 10.331 File.Close\ Tab :tabclose<CR>
an 20.460 Edit.-SEP4- <Nop>