[vlc-commits] macosx: implemented the 'autoscale' feature and fixed some resizing bugs

Felix Paul Kühne git at videolan.org
Wed Aug 10 18:44:54 CEST 2011


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Aug 10 16:25:13 2011 +0200| [840d653ffdfb7bfbfdc06a6f1dfd1ab6bb5f52c8] | committer: Felix Paul Kühne

macosx: implemented the 'autoscale' feature and fixed some resizing bugs

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=840d653ffdfb7bfbfdc06a6f1dfd1ab6bb5f52c8
---

 .../English.lproj/MainMenu.nib/designable.nib      |   21 +++++++++++--------
 .../English.lproj/MainMenu.nib/keyedobjects.nib    |  Bin 120808 -> 120951 bytes
 modules/gui/macosx/MainMenu.m                      |    3 +-
 modules/gui/macosx/MainWindow.m                    |   11 ++-------
 modules/gui/macosx/intf.m                          |    3 +-
 modules/video_output/macosx.m                      |    6 ++++-
 6 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
index 954cce4..6567eca 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
@@ -21,14 +21,14 @@
     </object>
     <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
       <bool key="EncodedWithXMLCoder">YES</bool>
-      <integer value="2730"/>
+      <integer value="21"/>
       <integer value="915"/>
-      <integer value="2"/>
-      <integer value="283"/>
+      <integer value="4596"/>
+      <integer value="2730"/>
       <integer value="1617"/>
       <integer value="334"/>
+      <integer value="283"/>
       <integer value="4722"/>
-      <integer value="4596"/>
     </object>
     <object class="NSArray" key="IBDocument.PluginDependencies">
       <bool key="EncodedWithXMLCoder">YES</bool>
@@ -861,7 +861,7 @@
                     <object class="BGHUDLabel" id="609070979">
                       <reference key="NSNextResponder" ref="440594360"/>
                       <int key="NSvFlags">266</int>
-                      <string key="NSFrame">{{4, 257}, {154, 14}}</string>
+                      <string key="NSFrame">{{4, 257}, {362, 14}}</string>
                       <reference key="NSSuperview" ref="440594360"/>
                       <int key="NSViewLayerContentsRedrawPolicy">2</int>
                       <bool key="NSEnabled">YES</bool>
@@ -884,7 +884,7 @@
                     <object class="NSSearchField" id="596740638">
                       <reference key="NSNextResponder" ref="440594360"/>
                       <int key="NSvFlags">265</int>
-                      <string key="NSFrame">{{371, 255}, {110, 19}}</string>
+                      <string key="NSFrame">{{371, 254}, {110, 19}}</string>
                       <reference key="NSSuperview" ref="440594360"/>
                       <int key="NSViewLayerContentsRedrawPolicy">2</int>
                       <bool key="NSEnabled">YES</bool>
@@ -1227,7 +1227,9 @@
         <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
         <string key="NSMinSize">{400, 310}</string>
         <string key="NSMaxSize">{1.7976931348623157e+308, 1.7976931348623157e+308}</string>
-        <string key="NSFrameAutosaveName">vlc-10thanniversary</string>
+        <string key="NSFrameAutosaveName">mainwindow</string>
+        <bool key="NSAutorecalculatesContentBorderThicknessMinY">NO</bool>
+        <bool key="NSAutorecalculatesContentBorderThicknessMaxY">NO</bool>
         <bool key="NSWindowIsRestorable">YES</bool>
       </object>
       <object class="NSMenu" id="782168084">
@@ -4431,10 +4433,11 @@ LCAuLi4</string>
             <int key="NSBoxType">0</int>
             <int key="NSTitlePosition">0</int>
             <bool key="NSTransparent">NO</bool>
+            <bool key="NSFullyTransparent">YES</bool>
           </object>
           <object class="NSImageView" id="619354303">
             <reference key="NSNextResponder" ref="256817023"/>
-            <int key="NSvFlags">306</int>
+            <int key="NSvFlags">274</int>
             <object class="NSMutableSet" key="NSDragTypes">
               <bool key="EncodedWithXMLCoder">YES</bool>
               <object class="NSArray" key="set.sortedObjects">
@@ -11378,7 +11381,7 @@ LCAuLi4</string>
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
           <object class="NSAffineTransform">
-            <bytes key="NSTransformStruct">P4AAAL+AAABDJsYAwpIAAA</bytes>
+            <bytes key="NSTransformStruct">P4AAAL+AAABCJAAAwhQAAA</bytes>
           </object>
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
           <string>VLBrushedMetalImageView</string>
diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
index 48e9aa6..32d920e 100644
Binary files a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ
diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index d49d0df..63edfd8 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -584,8 +584,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
                 var_SetFloat( p_vout, "zoom", 2.0 );
             else
             {
-                if (![[VLCMainWindow sharedInstance] isZoomed])
-                    [[VLCMainWindow sharedInstance] performZoom: sender];
+                var_ToggleBool( p_vout, "autoscale" );
             }
             vlc_object_release( p_vout );
         }
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 3a59d4d..f3cf733 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -217,6 +217,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [o_video_view setFrame: [o_split_view frame]];
     o_temp_view = [[NSView alloc] init];
     [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
+    [o_dropzone_view setFrame: [o_playlist_table frame]];
 
     /* create the sidebar */
     o_sidebaritems = [[NSMutableArray alloc] init];
@@ -313,12 +314,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
     [o_sidebar_view reloadData];
     [o_sidebar_view selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:YES];
-
-    playlist_t *p_playlist = pl_Get( VLCIntf );
-    PL_LOCK;
-    if( playlist_CurrentSize( p_playlist ) < 1 )
-        [self showDropZone];
-    PL_UNLOCK;
 }
 
 #pragma mark -
@@ -569,7 +564,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 - (void)showDropZone
 {
     [o_right_split_view addSubview: o_dropzone_view];
-    [[o_dropzone_view animator] setFrame: [o_playlist_table frame]];
+    [o_dropzone_view setFrame: [o_playlist_table frame]];
     [[o_playlist_table animator] setHidden:YES];
 }
 
@@ -939,7 +934,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
             if ([screen isMainScreen])
                 SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
 
-            [[o_video_view superview] replaceSubview:o_dropzone_view with:o_temp_view];
+            [[o_video_view superview] replaceSubview:o_video_view with:o_temp_view];
             [o_temp_view setFrame:[o_video_view frame]];
             [o_fullscreen_window setContentView:o_video_view];
 
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 7e643dc..9e66893 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -298,7 +298,6 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
             break;
 
         case INPUT_EVENT_ABORT:
-            //NSLog( @"input stopped by user" );
             break;
 
         default:
@@ -609,6 +608,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     [self _removeOldPreferences];
 
+    [o_mainwindow updateWindow];
     [o_mainwindow updateTimeSlider];
     [o_mainwindow updateVolumeSlider];
     [o_mainwindow makeKeyAndOrderFront: self];
@@ -1252,6 +1252,7 @@ unsigned int CocoaKeyToVLC( unichar i_key )
 
     [o_playlist updateRowSelection];
     [o_mainwindow updateWindow];
+    [o_mainwindow updateName];
     [o_mainmenu setupMenus];
     [o_mainmenu updatePlaybackRate];
 }
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 0750323..19fa96f 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -302,8 +302,12 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                 [[sys->glView window] setLevel: NSNormalWindowLevel];
             return VLC_SUCCESS;
         }
-        case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
         case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
+        {
+            [[sys->glView window] performZoom: nil];
+            return VLC_SUCCESS;
+        }
+        case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
         case VOUT_DISPLAY_CHANGE_ZOOM:
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP:



More information about the vlc-commits mailing list