Enable ‘Go → Reload’ when text view is focused

Previously would only work if focus was in the file browser.

Issue #674.
This commit is contained in:
Allan Odgaard
2013-01-16 04:24:15 +01:00
parent 2e43970d05
commit a2a3bf96b5

View File

@@ -1245,6 +1245,8 @@ namespace
- (CGFloat)fileBrowserWidth { return self.layoutView.fileBrowserWidth; }
- (void)setFileBrowserWidth:(CGFloat)aWidth { self.layoutView.fileBrowserWidth = aWidth; }
- (IBAction)reload:(id)sender { [NSApp sendAction:_cmd to:self.fileBrowser from:sender]; }
- (IBAction)revealFileInProject:(id)sender { self.fileBrowserVisible = YES; [self.fileBrowser selectURL:[NSURL fileURLWithPath:[NSString stringWithCxxString:[self selectedDocument]->path()]] withParentURL:[NSURL fileURLWithPath:self.projectPath]]; }
- (IBAction)goToProjectFolder:(id)sender { self.fileBrowserVisible = YES; [self.fileBrowser goToURL:[NSURL fileURLWithPath:self.projectPath]]; }
@@ -1620,6 +1622,8 @@ static std::string file_chooser_glob (std::string const& path)
active = self.projectPath != nil;
else if([menuItem action] == @selector(goToParentFolder:))
active = [self.window firstResponder] != self.textView;
else if([menuItem action] == @selector(reload:))
active = self.fileBrowserVisible;
return active;
}