diff --git a/Makefile.am b/Makefile.am index 996970eac6..0245d719de 100644 --- a/Makefile.am +++ b/Makefile.am @@ -187,6 +187,8 @@ EXTRA_DIST += \ extras/package/macosx/Resources/mainwindow/back.png \ extras/package/macosx/Resources/mainwindow/bottom-background.png \ extras/package/macosx/Resources/mainwindow/bottombar-mini.png \ + extras/package/macosx/Resources/mainwindow_dark/bottomdark-left.png \ + extras/package/macosx/Resources/mainwindow_dark/bottomdark-right.png \ extras/package/macosx/Resources/mainwindow/dropzone-background.png \ extras/package/macosx/Resources/mainwindow/dropzone.png \ extras/package/macosx/Resources/mainwindow/effects-double-buttons-blue.png \ diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.xib b/extras/package/macosx/Resources/English.lproj/MainMenu.xib index 055bdfe208..af1782166a 100644 --- a/extras/package/macosx/Resources/English.lproj/MainMenu.xib +++ b/extras/package/macosx/Resources/English.lproj/MainMenu.xib @@ -21,16 +21,16 @@ YES + - - - - - + + + - + + YES @@ -1143,7 +1143,7 @@ 2 YES - VLBrushedMetalImageView + VLCThreePartDropView {604, 310} @@ -14802,6 +14802,52 @@ LCAuLi4 + + YES + + ITSlider + NSSlider + + IBDocumentRelativeSource + ../../../../../modules/gui/macosx/misc.h + + + + TimeLineSlider + NSSlider + + + + VLBrushedMetalImageView + NSImageView + + + + VLCControllerView + NSView + + + + VLCMainWindowSplitView + NSSplitView + + + + VLCThreePartDropView + VLCThreePartImageView + + + + VLCThreePartImageView + NSView + + + + VLCTimeField + NSTextField + + + YES diff --git a/extras/package/macosx/Resources/mainwindow_dark/bottomdark-left.png b/extras/package/macosx/Resources/mainwindow_dark/bottomdark-left.png new file mode 100644 index 0000000000..57f33a7051 Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/bottomdark-left.png differ diff --git a/extras/package/macosx/Resources/mainwindow_dark/bottomdark-right.png b/extras/package/macosx/Resources/mainwindow_dark/bottomdark-right.png new file mode 100644 index 0000000000..0761dcd5ef Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/bottomdark-right.png differ diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj b/extras/package/macosx/vlc.xcodeproj/project.pbxproj index bfa5979d78..1118b0f5b8 100644 --- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj +++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj @@ -156,6 +156,8 @@ CC0586BD14ACF7C000659A99 /* sidebar-pictures.png in Resources */ = {isa = PBXBuildFile; fileRef = CC0586B714ACF7C000659A99 /* sidebar-pictures.png */; }; CC0586BE14ACF7C000659A99 /* sidebar-playlist.png in Resources */ = {isa = PBXBuildFile; fileRef = CC0586B814ACF7C000659A99 /* sidebar-playlist.png */; }; CC0586BF14ACF7C000659A99 /* sidebar-podcast.png in Resources */ = {isa = PBXBuildFile; fileRef = CC0586B914ACF7C000659A99 /* sidebar-podcast.png */; }; + CC1655D314EEA1DE00FAA66F /* bottomdark-left.png in Resources */ = {isa = PBXBuildFile; fileRef = CC1655D114EEA1DE00FAA66F /* bottomdark-left.png */; }; + CC1655D414EEA1DE00FAA66F /* bottomdark-right.png in Resources */ = {isa = PBXBuildFile; fileRef = CC1655D214EEA1DE00FAA66F /* bottomdark-right.png */; }; CC206B3814ACFEAC007935C6 /* lion-window-close-graphite.png in Resources */ = {isa = PBXBuildFile; fileRef = CC206B1314ACFEAC007935C6 /* lion-window-close-graphite.png */; }; CC206B3914ACFEAC007935C6 /* lion-window-close-on-graphite.png in Resources */ = {isa = PBXBuildFile; fileRef = CC206B1414ACFEAC007935C6 /* lion-window-close-on-graphite.png */; }; CC206B3A14ACFEAC007935C6 /* lion-window-close-on.png in Resources */ = {isa = PBXBuildFile; fileRef = CC206B1514ACFEAC007935C6 /* lion-window-close-on.png */; }; @@ -473,6 +475,8 @@ CC0CD0E013DE0EAE00B0D90D /* PXSourceList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PXSourceList.m; path = ../../../modules/gui/macosx/PXSourceList.m; sourceTree = ""; }; CC0CD0E113DE0EAE00B0D90D /* PXSourceListDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PXSourceListDataSource.h; path = ../../../modules/gui/macosx/PXSourceListDataSource.h; sourceTree = ""; }; CC0CD0E213DE0EAE00B0D90D /* PXSourceListDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PXSourceListDelegate.h; path = ../../../modules/gui/macosx/PXSourceListDelegate.h; sourceTree = ""; }; + CC1655D114EEA1DE00FAA66F /* bottomdark-left.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "bottomdark-left.png"; path = "Resources/mainwindow_dark/bottomdark-left.png"; sourceTree = ""; }; + CC1655D214EEA1DE00FAA66F /* bottomdark-right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "bottomdark-right.png"; path = "Resources/mainwindow_dark/bottomdark-right.png"; sourceTree = ""; }; CC1941240B9C1F8400635F6B /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; CC1C41D00D9BAD7F002728FA /* noart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = noart.png; path = Resources/noart.png; sourceTree = ""; }; CC206B1314ACFEAC007935C6 /* lion-window-close-graphite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lion-window-close-graphite.png"; sourceTree = ""; }; @@ -852,6 +856,8 @@ CC04321213B246DF00D7D52E /* back-pressed_dark.png */, CC9B43B013B29FCF000205AE /* bottom-background_dark.png */, CC5800F61423A81500166912 /* bottombar-mini.png */, + CC1655D114EEA1DE00FAA66F /* bottomdark-left.png */, + CC1655D214EEA1DE00FAA66F /* bottomdark-right.png */, CC04321313B246DF00D7D52E /* effects-double-buttons_dark.png */, CC04321413B246DF00D7D52E /* effects-double-buttons-blue_dark.png */, CC04321513B246DF00D7D52E /* effects-double-buttons-pressed_dark.png */, @@ -1513,6 +1519,8 @@ CC206B6E14AD0A5D007935C6 /* window-fullscreen-on.png in Resources */, CC206B6F14AD0A5D007935C6 /* window-fullscreen-over.png in Resources */, CC206B7014AD0A5D007935C6 /* window-fullscreen.png in Resources */, + CC1655D314EEA1DE00FAA66F /* bottomdark-left.png in Resources */, + CC1655D414EEA1DE00FAA66F /* bottomdark-right.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m index c0bde07659..af510f4dc2 100644 --- a/modules/gui/macosx/MainWindow.m +++ b/modules/gui/macosx/MainWindow.m @@ -149,7 +149,7 @@ static VLCMainWindow *_o_sharedInstance = nil; [o_dropzone_lbl setStringValue: _NS("Drop media here")]; if (!b_dark_interface) { - [o_bottombar_view setImage: [NSImage imageNamed:@"bottom-background"]]; + [o_bottombar_view setImagesLeft: [NSImage imageNamed:@"bottom-background"] middle: [NSImage imageNamed:@"bottom-background"] right: [NSImage imageNamed:@"bottom-background"]]; [o_bwd_btn setImage: [NSImage imageNamed:@"back"]]; [o_bwd_btn setAlternateImage: [NSImage imageNamed:@"back-pressed"]]; o_play_img = [[NSImage imageNamed:@"play"] retain]; @@ -192,7 +192,7 @@ static VLCMainWindow *_o_sharedInstance = nil; } else { - [o_bottombar_view setImage: [NSImage imageNamed:@"bottom-background_dark"]]; + [o_bottombar_view setImagesLeft: [NSImage imageNamed:@"bottomdark-left"] middle: [NSImage imageNamed:@"bottom-background_dark"] right: [NSImage imageNamed:@"bottomdark-right"]]; [o_bwd_btn setImage: [NSImage imageNamed:@"back_dark"]]; [o_bwd_btn setAlternateImage: [NSImage imageNamed:@"back-pressed_dark"]]; o_play_img = [[NSImage imageNamed:@"play_dark"] retain]; diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h index 049a3fa81f..3d5e00d2ca 100644 --- a/modules/gui/macosx/misc.h +++ b/modules/gui/macosx/misc.h @@ -185,3 +185,13 @@ - (void)setImagesLeft:(NSImage *)left middle: (NSImage *)middle right:(NSImage *)right; @end + +/***************************************************************************** + * VLCThreePartImageView interface + *****************************************************************************/ +@interface VLCThreePartDropView : VLCThreePartImageView +{ + +} + +@end diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m index 5ad67929c1..34fa00efc3 100644 --- a/modules/gui/macosx/misc.m +++ b/modules/gui/macosx/misc.m @@ -878,3 +878,99 @@ void _drawFrameInRect(NSRect frameRect) } @end + +@implementation VLCThreePartDropView + +- (BOOL)mouseDownCanMoveWindow +{ + return YES; +} + +- (void)dealloc +{ + [self unregisterDraggedTypes]; + [super dealloc]; +} + +- (void)awakeFromNib +{ + [self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType, + NSFilenamesPboardType, nil]]; +} + +- (NSDragOperation)draggingEntered:(id )sender +{ + if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) + == NSDragOperationGeneric) + { + return NSDragOperationGeneric; + } + else + { + return NSDragOperationNone; + } +} + +- (BOOL)prepareForDragOperation:(id )sender +{ + return YES; +} + +- (BOOL)performDragOperation:(id )sender +{ + NSPasteboard *o_paste = [sender draggingPasteboard]; + NSArray *o_types = [NSArray arrayWithObjects: NSFilenamesPboardType, nil]; + NSString *o_desired_type = [o_paste availableTypeFromArray:o_types]; + NSData *o_carried_data = [o_paste dataForType:o_desired_type]; + BOOL b_autoplay = config_GetInt( VLCIntf, "macosx-autoplay" ); + + if( o_carried_data ) + { + if ([o_desired_type isEqualToString:NSFilenamesPboardType]) + { + NSArray *o_array = [NSArray array]; + NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; + NSUInteger count = [o_values count]; + + input_thread_t * p_input = pl_CurrentInput( VLCIntf ); + BOOL b_returned = NO; + + if (count == 1 && p_input) + { + b_returned = input_AddSubtitle( p_input, make_URI([[o_values objectAtIndex:0] UTF8String], NULL), true ); + vlc_object_release( p_input ); + if(!b_returned) + return YES; + } + else if( p_input ) + vlc_object_release( p_input ); + + for( NSUInteger i = 0; i < count; i++) + { + NSDictionary *o_dic; + char *psz_uri = make_URI([[o_values objectAtIndex:i] UTF8String], NULL); + if( !psz_uri ) + continue; + + o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"]; + free( psz_uri ); + + o_array = [o_array arrayByAddingObject: o_dic]; + } + if( b_autoplay ) + [[[VLCMain sharedInstance] playlist] appendArray: o_array atPos: -1 enqueue:NO]; + else + [[[VLCMain sharedInstance] playlist] appendArray: o_array atPos: -1 enqueue:YES]; + return YES; + } + } + [self setNeedsDisplay:YES]; + return YES; +} + +- (void)concludeDragOperation:(id )sender +{ + [self setNeedsDisplay:YES]; +} + +@end