From 32f4cedece13e72eef1a35ffc2fa878a8462f2e3 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Wed, 21 Aug 2013 10:27:11 +0200 Subject: [PATCH] =?UTF-8?q?Bring=20HTML=20output=20window=20to=20front=20o?= =?UTF-8?q?n=20=E2=8C=83=E2=8C=A5=E2=8C=98H=20when=20not=20already=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously it would hide if already visible regardless of being the key window or not. --- Frameworks/DocumentWindow/src/DocumentController.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Frameworks/DocumentWindow/src/DocumentController.mm b/Frameworks/DocumentWindow/src/DocumentController.mm index a5f3dfd6..31b73662 100644 --- a/Frameworks/DocumentWindow/src/DocumentController.mm +++ b/Frameworks/DocumentWindow/src/DocumentController.mm @@ -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:))