From 0867bf7e602765fb0b9dcdc96a29da3928681a32 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Fri, 19 Feb 2010 20:35:18 +0000 Subject: [PATCH] MacGui: Preview replace a method that was hastily removed in 3125 when removing Full Screen. Fixes broken window scaling. git-svn-id: svn://localhost/HandBrake/trunk@3126 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/HBPreviewController.h | 2 +- macosx/HBPreviewController.m | 53 +++++++++++++++++++++++++++++++++++++++++++- macosx/PictureController.h | 1 - macosx/PictureController.m | 5 +---- 4 files changed, 54 insertions(+), 7 deletions(-) diff --git a/macosx/HBPreviewController.h b/macosx/HBPreviewController.h index 38c86c99..cbfd04c9 100644 --- a/macosx/HBPreviewController.h +++ b/macosx/HBPreviewController.h @@ -79,7 +79,7 @@ - (NSString*) pictureSizeInfoString; - (IBAction)toggleScaleToScreen:(id)sender; - +- (IBAction)goWindowedScreen:(id)sender; /* HUD overlay */ - (void) startHudTimer; diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m index cc0e7382..71634fcf 100644 --- a/macosx/HBPreviewController.m +++ b/macosx/HBPreviewController.m @@ -493,7 +493,58 @@ } - +- (IBAction)goWindowedScreen:(id)sender +{ + + /* Get the screen info to release the display but don't actually do + * it until the windowed screen is setup. + */ + scaleToScreen = NO; + [self pictureSliderChanged:nil]; + [fScaleToScreenToggleButton setTitle:@"<->"]; + + NSScreen* mainScreen = [NSScreen mainScreen]; + NSDictionary* screenInfo = [mainScreen deviceDescription]; + NSNumber* screenID = [screenInfo objectForKey:@"NSScreenNumber"]; + CGDirectDisplayID displayID = (CGDirectDisplayID)[screenID longValue]; + + [fFullScreenWindow dealloc]; + [fFullScreenWindow release]; + + + [fPreviewWindow setContentView:fPictureViewArea]; + [fPictureViewArea setNeedsDisplay:YES]; + [self setWindow:fPreviewWindow]; + + // Show the window. + [fPreviewWindow makeKeyAndOrderFront:self]; + + /* Set the window back to regular level */ + [fPreviewWindow setLevel:NSNormalWindowLevel]; + + /* Set the isFullScreen flag back to NO */ + //isFullScreen = NO; + scaleToScreen = NO; + /* make sure we are set to a still preview */ + [self pictureSliderChanged:nil]; + [self showPreviewWindow:nil]; + + /* Change the name of fFullScreenToggleButton appropriately */ + //[fFullScreenToggleButton setTitle: @"Full Screen"]; + // [fScaleToScreenToggleButton setHidden:YES]; + /* set the picture settings pallete back to normal level */ + [fHBController picturePanelWindowed]; + + /* Release the display now that the we are back in windowed mode */ + CGDisplayRelease(displayID); + + [fPreviewWindow setAcceptsMouseMovedEvents:YES]; + //[fFullScreenWindow setAcceptsMouseMovedEvents:NO]; + + hudTimerSeconds = 0; + [self startHudTimer]; + +} #pragma mark Still Preview Image Processing diff --git a/macosx/PictureController.h b/macosx/PictureController.h index fc8172f0..96ea118a 100644 --- a/macosx/PictureController.h +++ b/macosx/PictureController.h @@ -170,7 +170,6 @@ - (IBAction) resizeInspectorForTab: (id)sender; - (IBAction) showPreviewWindow: (id)sender; -- (IBAction) previewGoWindowed: (id)sender; - (IBAction) adjustSizingDisplay: (id) sender; diff --git a/macosx/PictureController.m b/macosx/PictureController.m index 5f916d8b..4cc39331 100644 --- a/macosx/PictureController.m +++ b/macosx/PictureController.m @@ -387,10 +387,7 @@ #pragma mark - -- (IBAction) previewGoWindowed: (id)sender -{ - [fPreviewController goWindowedScreen:self]; -} + - (IBAction) showPreviewWindow: (id)sender { -- 2.11.0