]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlist.m
* modules/gui/macosx/playlist.m: 10.1 is archaic. i don't know why i bother ;)
[vlc] / modules / gui / macosx / playlist.m
index 33f0088c01bf0708db32efece0d5a62d72c79f73..0d6cdc04f6e8b5fcf0de845df5e9ffb4334f637a 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: playlist.m,v 1.25 2003/06/02 12:42:15 hartman Exp $
+ * $Id: playlist.m,v 1.26 2003/06/29 00:14:50 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <sys/param.h>                                    /* for MAXPATHLEN */
 #include <string.h>
+#include <math.h>
 
 #include "intf.h"
 #include "playlist.h"
 
+int MacVersion102 = -1;
+
 /*****************************************************************************
  * VLCPlaylistView implementation 
  *****************************************************************************/
     o_new_rect.size.height = f_height;
     o_new_rect.origin.x = o_rect.origin.x;
     o_new_rect.origin.y = i_row * f_height;
-    
-    if ( o_striped_row_color == nil )
+   
+    if( ( MacVersion102 < 0 ) && ( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_1 ) )
+    {
+        MacVersion102 = 102;
+    }
+    if ( MacVersion102 == 102 && o_striped_row_color == nil )
     {
         o_striped_row_color = [[[NSColor alternateSelectedControlColor]
                                 highlightWithLevel: 0.90] retain];
         
-        if ( o_striped_row_color == nil )
-        {
-            /* OSX 10.1 and before ain't that smart ;) */
-            o_striped_row_color = [[NSColor whiteColor] retain];
-        }
     }
+    else if ( o_striped_row_color == nil )
+    {
+        /* OSX 10.1 and before ain't that smart ;) */
+        o_striped_row_color = [[NSColor whiteColor] retain];
+    }
+
     [o_striped_row_color set];
     
     while ( o_new_rect.origin.y < f_origin_y ) {