Bring HTML output window to front on ⌃⌥⌘H when not already key

Previously it would hide if already visible regardless of being the key window or not.
This commit is contained in:
Allan Odgaard
2013-08-21 10:27:11 +02:00
parent cab42a83c5
commit 32f4cedece

View File

@@ -1756,7 +1756,9 @@ namespace
- (IBAction)toggleHTMLOutput:(id)sender
{
self.htmlOutputVisible = !self.htmlOutputVisible;
if(self.htmlOutputVisible && self.htmlOutputInWindow && ![self.htmlOutputWindowController.window isKeyWindow])
[self.htmlOutputWindowController.window makeKeyAndOrderFront:self];
else self.htmlOutputVisible = !self.htmlOutputVisible;
}
- (BOOL)setCommandRunner:(command::runner_ptr const&)aRunner
@@ -2039,7 +2041,7 @@ namespace
[menuItem setTitle:self.fileBrowserVisible ? @"Hide File Browser" : @"Show File Browser"];
else if([menuItem action] == @selector(toggleHTMLOutput:))
{
[menuItem setTitle:self.htmlOutputVisible ? @"Hide HTML Output" : @"Show HTML Output"];
[menuItem setTitle:(!self.htmlOutputVisible || self.htmlOutputInWindow && ![self.htmlOutputWindowController.window isKeyWindow]) ? @"Show HTML Output" : @"Hide HTML Output"];
active = !self.htmlOutputInWindow || self.htmlOutputWindowController;
}
else if([menuItem action] == @selector(newDocumentInDirectory:))