]> git.sesse.net Git - vlc/commitdiff
macosx: fixed rounded bottom corners when using the black window style
authorFelix Paul Kühne <fkuehne@videolan.org>
Fri, 17 Feb 2012 14:58:42 +0000 (15:58 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Fri, 17 Feb 2012 14:59:10 +0000 (15:59 +0100)
Makefile.am
extras/package/macosx/Resources/English.lproj/MainMenu.xib
extras/package/macosx/Resources/mainwindow_dark/bottomdark-left.png [new file with mode: 0644]
extras/package/macosx/Resources/mainwindow_dark/bottomdark-right.png [new file with mode: 0644]
extras/package/macosx/vlc.xcodeproj/project.pbxproj
modules/gui/macosx/MainWindow.m
modules/gui/macosx/misc.h
modules/gui/macosx/misc.m

index 996970eac6adeeeb7bf76ab715a671f01de019fb..0245d719ded3df4996d34b1fc90f9bcf7cfde848 100644 (file)
@@ -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 \
index 055bdfe208b864dab1b675998c6cc1786be4ef0a..af1782166a948d916ac34a097d98fa1f1e62b23d 100644 (file)
     </object>
     <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
       <bool key="EncodedWithXMLCoder">YES</bool>
+      <integer value="21"/>
       <integer value="4895"/>
-      <integer value="1617"/>
+      <integer value="915"/>
       <integer value="283"/>
-      <integer value="4756"/>
-      <integer value="4596"/>
       <integer value="29"/>
-      <integer value="915"/>
+      <integer value="1617"/>
       <integer value="2770"/>
-      <integer value="2730"/>
       <integer value="4722"/>
+      <integer value="2730"/>
+      <integer value="4596"/>
     </object>
     <object class="NSArray" key="IBDocument.PluginDependencies">
       <bool key="EncodedWithXMLCoder">YES</bool>
               <reference key="NSSuperview" ref="429932428"/>
               <int key="NSViewLayerContentsRedrawPolicy">2</int>
               <bool key="NSViewCanDrawConcurrently">YES</bool>
-              <string key="NSClassName">VLBrushedMetalImageView</string>
+              <string key="NSClassName">VLCThreePartDropView</string>
             </object>
           </object>
           <string key="NSFrameSize">{604, 310}</string>
@@ -14802,6 +14802,52 @@ LCAuLi4</string>
           <reference key="sourceIdentifier" ref="925772039"/>
         </object>
       </object>
+      <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
+        <bool key="EncodedWithXMLCoder">YES</bool>
+        <object class="IBPartialClassDescription">
+          <string key="className">ITSlider</string>
+          <string key="superclassName">NSSlider</string>
+          <object class="IBClassDescriptionSource" key="sourceIdentifier" id="386911354">
+            <string key="majorKey">IBDocumentRelativeSource</string>
+            <string key="minorKey">../../../../../modules/gui/macosx/misc.h</string>
+          </object>
+        </object>
+        <object class="IBPartialClassDescription">
+          <string key="className">TimeLineSlider</string>
+          <string key="superclassName">NSSlider</string>
+          <reference key="sourceIdentifier" ref="386911354"/>
+        </object>
+        <object class="IBPartialClassDescription">
+          <string key="className">VLBrushedMetalImageView</string>
+          <string key="superclassName">NSImageView</string>
+          <reference key="sourceIdentifier" ref="386911354"/>
+        </object>
+        <object class="IBPartialClassDescription">
+          <string key="className">VLCControllerView</string>
+          <string key="superclassName">NSView</string>
+          <reference key="sourceIdentifier" ref="386911354"/>
+        </object>
+        <object class="IBPartialClassDescription">
+          <string key="className">VLCMainWindowSplitView</string>
+          <string key="superclassName">NSSplitView</string>
+          <reference key="sourceIdentifier" ref="386911354"/>
+        </object>
+        <object class="IBPartialClassDescription">
+          <string key="className">VLCThreePartDropView</string>
+          <string key="superclassName">VLCThreePartImageView</string>
+          <reference key="sourceIdentifier" ref="386911354"/>
+        </object>
+        <object class="IBPartialClassDescription">
+          <string key="className">VLCThreePartImageView</string>
+          <string key="superclassName">NSView</string>
+          <reference key="sourceIdentifier" ref="386911354"/>
+        </object>
+        <object class="IBPartialClassDescription">
+          <string key="className">VLCTimeField</string>
+          <string key="superclassName">NSTextField</string>
+          <reference key="sourceIdentifier" ref="386911354"/>
+        </object>
+      </object>
       <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
         <bool key="EncodedWithXMLCoder">YES</bool>
         <object class="IBPartialClassDescription">
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 (file)
index 0000000..57f33a7
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 (file)
index 0000000..0761dcd
Binary files /dev/null and b/extras/package/macosx/Resources/mainwindow_dark/bottomdark-right.png differ
index bfa5979d78e92466a4d2cf241ac8eedff794e2f9..1118b0f5b874c7b7dced67357d5311d7dac49a94 100644 (file)
                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 */; };
                CC0CD0E013DE0EAE00B0D90D /* PXSourceList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PXSourceList.m; path = ../../../modules/gui/macosx/PXSourceList.m; sourceTree = "<group>"; };
                CC0CD0E113DE0EAE00B0D90D /* PXSourceListDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PXSourceListDataSource.h; path = ../../../modules/gui/macosx/PXSourceListDataSource.h; sourceTree = "<group>"; };
                CC0CD0E213DE0EAE00B0D90D /* PXSourceListDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PXSourceListDelegate.h; path = ../../../modules/gui/macosx/PXSourceListDelegate.h; sourceTree = "<group>"; };
+               CC1655D114EEA1DE00FAA66F /* bottomdark-left.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "bottomdark-left.png"; path = "Resources/mainwindow_dark/bottomdark-left.png"; sourceTree = "<group>"; };
+               CC1655D214EEA1DE00FAA66F /* bottomdark-right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "bottomdark-right.png"; path = "Resources/mainwindow_dark/bottomdark-right.png"; sourceTree = "<group>"; };
                CC1941240B9C1F8400635F6B /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = "<absolute>"; };
                CC1C41D00D9BAD7F002728FA /* noart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = noart.png; path = Resources/noart.png; sourceTree = "<group>"; };
                CC206B1314ACFEAC007935C6 /* lion-window-close-graphite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lion-window-close-graphite.png"; sourceTree = "<group>"; };
                                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 */,
                                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;
                };
index c0bde07659960fcc7ded66c702da2032bc50b089..af510f4dc268ac1ee3f5af76e991cd94ad59bbad 100644 (file)
@@ -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];
index 049a3fa81f761c648386bc4d4fe912b6e4094119..3d5e00d2cab7cc90641e332b7f89988bea239100 100644 (file)
 
 - (void)setImagesLeft:(NSImage *)left middle: (NSImage *)middle right:(NSImage *)right;
 @end
+
+/*****************************************************************************
+ * VLCThreePartImageView interface
+ *****************************************************************************/
+@interface VLCThreePartDropView : VLCThreePartImageView
+{
+
+}
+
+@end
index 5ad67929c1b071d56a04a476cc065fa12957444e..34fa00efc3bd2f2020447f0a1c354accf43dab14 100644 (file)
@@ -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 <NSDraggingInfo>)sender
+{
+    if ((NSDragOperationGeneric & [sender draggingSourceOperationMask])
+        == NSDragOperationGeneric)
+    {
+        return NSDragOperationGeneric;
+    }
+    else
+    {
+        return NSDragOperationNone;
+    }
+}
+
+- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+{
+    return YES;
+}
+
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)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 <NSDraggingInfo>)sender
+{
+    [self setNeedsDisplay:YES];
+}
+
+@end