Commit 840d653f authored by Felix Paul Kühne's avatar Felix Paul Kühne

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

parent f4f58eb9
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
</object> </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="2730"/> <integer value="21"/>
<integer value="915"/> <integer value="915"/>
<integer value="2"/> <integer value="4596"/>
<integer value="283"/> <integer value="2730"/>
<integer value="1617"/> <integer value="1617"/>
<integer value="334"/> <integer value="334"/>
<integer value="283"/>
<integer value="4722"/> <integer value="4722"/>
<integer value="4596"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
...@@ -861,7 +861,7 @@ ...@@ -861,7 +861,7 @@
<object class="BGHUDLabel" id="609070979"> <object class="BGHUDLabel" id="609070979">
<reference key="NSNextResponder" ref="440594360"/> <reference key="NSNextResponder" ref="440594360"/>
<int key="NSvFlags">266</int> <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"/> <reference key="NSSuperview" ref="440594360"/>
<int key="NSViewLayerContentsRedrawPolicy">2</int> <int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
...@@ -884,7 +884,7 @@ ...@@ -884,7 +884,7 @@
<object class="NSSearchField" id="596740638"> <object class="NSSearchField" id="596740638">
<reference key="NSNextResponder" ref="440594360"/> <reference key="NSNextResponder" ref="440594360"/>
<int key="NSvFlags">265</int> <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"/> <reference key="NSSuperview" ref="440594360"/>
<int key="NSViewLayerContentsRedrawPolicy">2</int> <int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
...@@ -1227,7 +1227,9 @@ ...@@ -1227,7 +1227,9 @@
<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string> <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
<string key="NSMinSize">{400, 310}</string> <string key="NSMinSize">{400, 310}</string>
<string key="NSMaxSize">{1.7976931348623157e+308, 1.7976931348623157e+308}</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> <bool key="NSWindowIsRestorable">YES</bool>
</object> </object>
<object class="NSMenu" id="782168084"> <object class="NSMenu" id="782168084">
...@@ -4431,10 +4433,11 @@ LCAuLi4</string> ...@@ -4431,10 +4433,11 @@ LCAuLi4</string>
<int key="NSBoxType">0</int> <int key="NSBoxType">0</int>
<int key="NSTitlePosition">0</int> <int key="NSTitlePosition">0</int>
<bool key="NSTransparent">NO</bool> <bool key="NSTransparent">NO</bool>
<bool key="NSFullyTransparent">YES</bool>
</object> </object>
<object class="NSImageView" id="619354303"> <object class="NSImageView" id="619354303">
<reference key="NSNextResponder" ref="256817023"/> <reference key="NSNextResponder" ref="256817023"/>
<int key="NSvFlags">306</int> <int key="NSvFlags">274</int>
<object class="NSMutableSet" key="NSDragTypes"> <object class="NSMutableSet" key="NSDragTypes">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="set.sortedObjects"> <object class="NSArray" key="set.sortedObjects">
...@@ -11378,7 +11381,7 @@ LCAuLi4</string> ...@@ -11378,7 +11381,7 @@ LCAuLi4</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform"> <object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDJsYAwpIAAA</bytes> <bytes key="NSTransformStruct">P4AAAL+AAABCJAAAwhQAAA</bytes>
</object> </object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>VLBrushedMetalImageView</string> <string>VLBrushedMetalImageView</string>
......
...@@ -584,8 +584,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -584,8 +584,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
var_SetFloat( p_vout, "zoom", 2.0 ); var_SetFloat( p_vout, "zoom", 2.0 );
else else
{ {
if (![[VLCMainWindow sharedInstance] isZoomed]) var_ToggleBool( p_vout, "autoscale" );
[[VLCMainWindow sharedInstance] performZoom: sender];
} }
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
......
...@@ -217,6 +217,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -217,6 +217,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_video_view setFrame: [o_split_view frame]]; [o_video_view setFrame: [o_split_view frame]];
o_temp_view = [[NSView alloc] init]; o_temp_view = [[NSView alloc] init];
[o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
[o_dropzone_view setFrame: [o_playlist_table frame]];
/* create the sidebar */ /* create the sidebar */
o_sidebaritems = [[NSMutableArray alloc] init]; o_sidebaritems = [[NSMutableArray alloc] init];
...@@ -313,12 +314,6 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -313,12 +314,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_sidebar_view reloadData]; [o_sidebar_view reloadData];
[o_sidebar_view selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:YES]; [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 - #pragma mark -
...@@ -569,7 +564,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -569,7 +564,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)showDropZone - (void)showDropZone
{ {
[o_right_split_view addSubview: o_dropzone_view]; [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]; [[o_playlist_table animator] setHidden:YES];
} }
...@@ -939,7 +934,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -939,7 +934,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if ([screen isMainScreen]) if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); 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_temp_view setFrame:[o_video_view frame]];
[o_fullscreen_window setContentView:o_video_view]; [o_fullscreen_window setContentView:o_video_view];
......
...@@ -298,7 +298,6 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var, ...@@ -298,7 +298,6 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
break; break;
case INPUT_EVENT_ABORT: case INPUT_EVENT_ABORT:
//NSLog( @"input stopped by user" );
break; break;
default: default:
...@@ -609,6 +608,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -609,6 +608,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[self _removeOldPreferences]; [self _removeOldPreferences];
[o_mainwindow updateWindow];
[o_mainwindow updateTimeSlider]; [o_mainwindow updateTimeSlider];
[o_mainwindow updateVolumeSlider]; [o_mainwindow updateVolumeSlider];
[o_mainwindow makeKeyAndOrderFront: self]; [o_mainwindow makeKeyAndOrderFront: self];
...@@ -1252,6 +1252,7 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1252,6 +1252,7 @@ unsigned int CocoaKeyToVLC( unichar i_key )
[o_playlist updateRowSelection]; [o_playlist updateRowSelection];
[o_mainwindow updateWindow]; [o_mainwindow updateWindow];
[o_mainwindow updateName];
[o_mainmenu setupMenus]; [o_mainmenu setupMenus];
[o_mainmenu updatePlaybackRate]; [o_mainmenu updatePlaybackRate];
} }
......
...@@ -302,8 +302,12 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -302,8 +302,12 @@ static int Control (vout_display_t *vd, int query, va_list ap)
[[sys->glView window] setLevel: NSNormalWindowLevel]; [[sys->glView window] setLevel: NSNormalWindowLevel];
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: 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_ZOOM:
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT: case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
case VOUT_DISPLAY_CHANGE_SOURCE_CROP: case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment