diff options
author | dynaflash <[email protected]> | 2010-02-18 16:49:45 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2010-02-18 16:49:45 +0000 |
commit | 7252c9ad59ddb75248834aa88e6f18658d3e28de (patch) | |
tree | 4c0203d0c0a3dc0325970d7d04ee02d319638f04 /macosx | |
parent | 2b714549dae745f8fb7e626e2b2010439afd6bfc (diff) |
MacGui: Preview, use screens visibleFrame instead of frame to get better scale to screen effect and clear the dock, etc.
- Some other code additions to troubleshoot initial window scaling where there shouldn't be any.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3122 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBPreviewController.m | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m index f58c1f5d3..5fdef7edb 100644 --- a/macosx/HBPreviewController.m +++ b/macosx/HBPreviewController.m @@ -212,6 +212,7 @@ MaxOutputWidth = title->width - job->crop[2] - job->crop[3]; MaxOutputHeight = title->height - job->crop[0] - job->crop[1]; [self SettingsChanged: nil]; + } @@ -324,7 +325,6 @@ NSString *scaleString; CGFloat scale = ( ( CGFloat )[fPictureView frame].size.width) / ( ( CGFloat )imageScaledSize.width); if (scale * 100.0 != 100) - //if( imageScaledSize.height > [fPictureView frame].size.height) { //CGFloat scale = ( ( CGFloat )[fPictureView frame].size.width) / ( ( CGFloat )imageScaledSize.width); scaleString = [NSString stringWithFormat: @@ -1196,7 +1196,8 @@ // Now resize the whole panel by those same deltas, but don't exceed the min NSRect frame = [[self window] frame]; NSSize screenSize = [[[self window] screen] frame].size; - NSSize maxSize = [[self window] maxSize]; + //NSSize maxSize = [[self window] maxSize]; + NSSize maxSize = [[[self window] screen] visibleFrame].size; NSSize minSize = [[self window] minSize]; frame.size.width += deltaX; @@ -1210,6 +1211,18 @@ { frame.size.height = minSize.height; } + /* compare frame to max size of screen */ + if( frame.size.width > maxSize.width ) + { + frame.size.width = maxSize.width; + } + + if( frame.size.height > maxSize.height ) + { + frame.size.height = maxSize.height; + } + + // But now the sheet is off-center, so also shift the origin to center it and @@ -1239,17 +1252,15 @@ * So check the origin against the screen origin and adjust if * necessary. */ - NSSize screenSize = [[[self window] screen] frame].size; - CGFloat screenWidthMod = screenSize.width - 100; - CGFloat screenHeightMod = screenSize.height - 100; + NSSize screenSize = [[[self window] screen] visibleFrame].size; NSPoint screenOrigin = [[[self window] screen] frame].origin; - if (screenHeightMod < frame.size.height) + if (screenSize.height < frame.size.height) { - frame.size.height = screenHeightMod; + frame.size.height = screenSize.height; } - else if (screenWidthMod < frame.size.width) + if (screenSize.width < frame.size.width) { - frame.size.width = screenWidthMod; + frame.size.width = screenSize.width; } @@ -1279,12 +1290,11 @@ - (void)setViewSize: (NSSize)viewSize { /* special case for scaleToScreen */ - NSSize screenSize = [[[self window] screen] frame].size; + NSSize screenSize = [[[self window] screen] visibleFrame].size; NSSize areaSize = [fPictureViewArea frame].size; if (scaleToScreen == YES || viewSize.width > areaSize.width || viewSize.height > areaSize.height) { /* for scaleToScreen, we expand the fPictureView to fit the entire screen */ - //NSSize areaSize = [fPictureViewArea frame].size; CGFloat viewSizeAspect = viewSize.width / viewSize.height; if (viewSizeAspect > 1.0) // we are wider than taller, so expand the width to fill the area and scale the height { |