diff options
author | ritsuka <[email protected]> | 2015-02-18 07:47:23 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2015-02-18 07:47:23 +0000 |
commit | 44f7f22f2faf92e814663c26ef2687ffdf202885 (patch) | |
tree | 74289690fd3893597d77665f0d96c48006fea9ec | |
parent | be4ccff70f1cf7432d84dd285a8d8e398c93829a (diff) |
MacGui: do not make the output panel textview scroll to the bottom if the window is not visible. The scroll operation is expensive.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6923 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/HBAppDelegate.m | 2 | ||||
-rw-r--r-- | macosx/HBOutputPanelController.h | 1 | ||||
-rw-r--r-- | macosx/HBOutputPanelController.m | 13 |
3 files changed, 9 insertions, 7 deletions
diff --git a/macosx/HBAppDelegate.m b/macosx/HBAppDelegate.m index b87a77b07..c28164a9e 100644 --- a/macosx/HBAppDelegate.m +++ b/macosx/HBAppDelegate.m @@ -418,7 +418,7 @@ */ - (IBAction)showOutputPanel:(id)sender { - [self.outputPanel showOutputPanel:sender]; + [self.outputPanel showWindow:sender]; } - (IBAction)showPicturePanel:(id)sender diff --git a/macosx/HBOutputPanelController.h b/macosx/HBOutputPanelController.h index 14ab72dee..38a9f867c 100644 --- a/macosx/HBOutputPanelController.h +++ b/macosx/HBOutputPanelController.h @@ -13,7 +13,6 @@ */ @interface HBOutputPanelController : NSWindowController -- (IBAction)showOutputPanel:(id)sender; - (IBAction)clearOutput:(id)sender; - (IBAction)copyAllOutputToPasteboard:(id)sender; - (IBAction)openActivityLogFile:(id)sender; diff --git a/macosx/HBOutputPanelController.m b/macosx/HBOutputPanelController.m index 8b6e955d7..c275c3970 100644 --- a/macosx/HBOutputPanelController.m +++ b/macosx/HBOutputPanelController.m @@ -114,7 +114,7 @@ /** * Loads output panel from OutputPanel.nib and shows it. */ -- (IBAction)showOutputPanel:(id)sender +- (IBAction)showWindow:(id)sender { if ([[self window] isVisible]) { @@ -122,10 +122,10 @@ } else { - [textView scrollRangeToVisible:NSMakeRange([outputTextStorage length], 0)]; - [self showWindow:sender]; + [textView scrollToEndOfDocument:self]; + [super showWindow:sender]; - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"OutputPanelIsOpen"]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"OutputPanelIsOpen"]; } } @@ -209,7 +209,10 @@ if (outputTextStorage.length > TextStorageUpperSizeLimit) [outputTextStorage deleteCharactersInRange:NSMakeRange(0, [outputTextStorage length] - TextStorageLowerSizeLimit)]; - [textView scrollRangeToVisible:NSMakeRange([outputTextStorage length], 0)]; + if (self.window.isVisible) + { + [textView scrollToEndOfDocument:self]; + } FILE *f = fopen(_outputLogFile.fileSystemRepresentation, "a"); fprintf(f, "%s", text.UTF8String); |