OSDN Git Service

LinGui: make Help->Guide work on windows/mingw
[handbrake-jp/handbrake-jp-git.git] / macosx / PictureController.m
index b02dab7..4cc3933 100644 (file)
 //------------------------------------------------------------------------------------
 - (IBAction) showPictureWindow: (id)sender
 {
-    if ([fPreviewController fullScreen] == YES)
-    {
-        [self showWindow:sender];
-        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"PictureSizeWindowIsOpen"];
-        [self setToFullScreenMode];
-    }
-    else
-    {
+
+
         if ([[self window] isVisible])
         {
             [[self window] close];
             [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"PictureSizeWindowIsOpen"];
             [self setToWindowedMode];
         }
-    }
+
     [self adjustFilterDisplay:nil];
     [self adjustSizingDisplay:nil];
 }
 
-- (BOOL) previewFullScreenMode
-{
-    return [fPreviewController fullScreen];
-}
+
 
 /* this method is used to detect clicking on a tab in fSizeFilterView */
 - (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem
 
 #pragma mark -
 
-- (IBAction) previewGoWindowed: (id)sender
-{
-    [fPreviewController goWindowedScreen:self];
-}
+
 
 - (IBAction) showPreviewWindow: (id)sender
 {
 
 
 
-
-- (void) setToFullScreenMode
-{
-    int32_t shieldLevel = CGShieldingWindowLevel(); 
-    
-    [fPictureWindow setLevel:shieldLevel + 1]; 
-    // Show the window. 
-    [fPictureWindow makeKeyAndOrderFront:self];
-}
-
 - (void) setToWindowedMode
 {
     /* Set the window back to Floating Window mode 
     {
         [fModulusLabel setHidden:NO];
         [fModulusPopUp setHidden:NO];
+        if (sender == fModulusPopUp)
+        {
+            /* do a dry run with hb_fix aspect to get new modulus */
+            job->modulus = [[fModulusPopUp titleOfSelectedItem] intValue];
+            job->keep_ratio  = 1;
+            hb_fix_aspect( job, HB_KEEP_WIDTH );
+            if( job->height > fTitle->height )
+            {
+                job->height = fTitle->height;
+                hb_fix_aspect( job, HB_KEEP_HEIGHT );
+            }
+            [fWidthStepper      setIntValue: job->width];
+            [fWidthField        setIntValue: job->width];
+            if( [fAnamorphicPopUp indexOfSelectedItem] != 2) // if we are not loose or custom
+            {
+                [fHeightStepper     setIntValue: job->height];
+                [fHeightField       setIntValue: job->height];
+            }    
+        }
     }
     else
     {