OSDN Git Service

MacGui: Set the hud control panels origin based on the size of the actual preview...
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 2 Jun 2010 16:49:18 +0000 (16:49 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 2 Jun 2010 16:49:18 +0000 (16:49 +0000)
- Should not block the actual preview as much.
- Move the origin setting code from -SetTitle into -displayPreview so that it is recalculated any time a new preview is generated, which includes changing encode size.

git-svn-id: svn://localhost/HandBrake/trunk@3349 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBPreviewController.m

index 5ad5976..4b60d7e 100644 (file)
     MaxOutputHeight = title->height - job->crop[0] - job->crop[1];
     
     [self SettingsChanged: nil];
-    
-    /* set the top of the hud controller boxes centered vertically with the origin of our window */
-    NSPoint hudControlBoxOrigin = [fPictureControlBox frame].origin;
-    hudControlBoxOrigin.y = ([[self window] frame].size.height / 2) - [fPictureControlBox frame].size.height;
-    [fPictureControlBox setFrameOrigin:hudControlBoxOrigin];
-    [fEncodingControlBox setFrameOrigin:hudControlBoxOrigin];
-    [fMoviePlaybackControlBox setFrameOrigin:hudControlBoxOrigin];
 
 }
 
     }
     
     [self setViewSize:viewSize];
+    
+    /* relocate our hud origins as per setViewSize */
+    NSPoint hudControlBoxOrigin = [fPictureControlBox frame].origin;
+    hudControlBoxOrigin.y = ([[self window] frame].size.height / 2) - (viewSize.height / 2);
+    hudControlBoxOrigin.x = ([[self window] frame].size.width / 2) - ([fPictureControlBox frame].size.width / 2);
+    [fPictureControlBox setFrameOrigin:hudControlBoxOrigin];
+    [fEncodingControlBox setFrameOrigin:hudControlBoxOrigin];
+    [fMoviePlaybackControlBox setFrameOrigin:hudControlBoxOrigin];
+
 
     NSString *scaleString;
     CGFloat scale = ( ( CGFloat )[fPictureView frame].size.width) / ( ( CGFloat )imageScaledSize.width);