legacy macosx intf: make sure we display the right playback button graphic when drawi...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sat, 13 Mar 2010 19:46:04 +0000 (20:46 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 13 Mar 2010 19:46:04 +0000 (20:46 +0100)
modules/gui/macosx/controls.m
modules/gui/macosx/embeddedwindow.m

index 29ad6af..c64f2ef 100644 (file)
@@ -84,7 +84,7 @@
     {
         o_repeat_single = [NSImage imageNamed:@"repeat_single_embedded_graphite"];
         o_repeat_all = [NSImage imageNamed:@"repeat_embedded_graphite"];
-        
+
         [o_btn_shuffle setAlternateImage: [NSImage imageNamed: @"shuffle_embedded_graphite"]];
         [o_btn_addNode setAlternateImage: [NSImage imageNamed: @"add_embedded_graphite"]];
     }
     {
         o_repeat_single = [NSImage imageNamed:@"repeat_single_embedded_blue"];
         o_repeat_all = [NSImage imageNamed:@"repeat_embedded_blue"];
-        
+
         [o_btn_shuffle setAlternateImage: [NSImage imageNamed: @"shuffle_embedded_blue"]];
         [o_btn_addNode setAlternateImage: [NSImage imageNamed: @"add_embedded_blue"]];
     }
-    
+
     /* update the repeat button, but keep its state */
     if( i_repeat == 1 )
         [self repeatOne];
 - (void)dealloc
 {
     [[NSNotificationCenter defaultCenter] removeObserver: self];
-    
+
     [o_fs_panel release];
     [o_repeat_single release];
     [o_repeat_all release];
     [o_repeat_off release];
-    
+
     [super dealloc];
 }
 
        if(val.b_bool)
         [o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffleOn"]];
        else
-        [o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffle"]];    
+        [o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffle"]];
 }
 
 - (IBAction)repeatButtonAction:(id)sender
     if( !repeating.b_bool && !looping.b_bool )
     {
         /* was: no repeating at all, switching to Repeat One */
+
         /* set our button's look */
         [self repeatOne];
+
         /* prepare core communication */
         repeating.b_bool = true;
         looping.b_bool = false;
         config_PutInt( p_playlist, "repeat", 1 );
         config_PutInt( p_playlist, "loop", 0 );
+
         /* show the change */
         vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat One" ) );
     }
     else if( repeating.b_bool && !looping.b_bool )
     {
         /* was: Repeat One, switching to Repeat All */
+
         /* set our button's look */
         [self repeatAll];
+
         /* prepare core communication */
         repeating.b_bool = false;
         looping.b_bool = true;
         config_PutInt( p_playlist, "repeat", 0 );
         config_PutInt( p_playlist, "loop", 1 );
+
         /* show the change */
         vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat All" ) );
     }
     else
     {
         /* was: Repeat All or bug in VLC, switching to Repeat Off */
+
         /* set our button's look */
         [self repeatOff];
+
         /* prepare core communication */
         repeating.b_bool = false;
         looping.b_bool = false;
         config_PutInt( p_playlist, "repeat", 0 );
         config_PutInt( p_playlist, "loop", 0 );
+
         /* show the change */
         vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat Off" ) );
     }
         vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat Off" ) );
         config_PutInt( p_playlist, "repeat", 0 );
     }
+
     p_intf->p_sys->b_playmode_update = true;
     p_intf->p_sys->b_intf_update = true;
 }
     {
         NSUInteger c = 0;
         if( !p_input ) return;
-        
+
         c = [[openPanel filenames] count];
 
         for (int i = 0; i < [[openPanel filenames] count] ; i++)
         /* Variable doesn't exist or isn't handled */
         return;
     }
+
     /* Make sure we want to display the variable */
     if( i_type & VLC_VAR_HASCHOICE )
     {
         if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 )
             return;
     }
+
     /* Get the descriptive name of the variable */
     var_Change( p_object, psz_variable, VLC_VAR_GETTEXT, &text, NULL );
     [o_mi setTitle: [[VLCMain sharedInstance] localizedString: text.psz_string ?
 
         [self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
                         var:psz_variable selector:pf_callback];
+
         free( text.psz_string );
         return;
     }
         NSArray *o_windows = [NSApp orderedWindows];
         NSEnumerator *o_enumerator = [o_windows objectEnumerator];
         bEnabled = FALSE;
+
         if( p_input != NULL )
         {
             vout_thread_t *p_vout = input_GetVout( p_input );
                     var_Get( p_vout, "video-on-top", &val );
                     [o_mi setState: val.b_bool ?  NSOnState : NSOffState];
                 }
-    
+
                 while( (o_window = [o_enumerator nextObject]))
                 {
                     if( [[o_window className] isEqualToString: @"VLCVoutWindow"] ||
                         break;
                     }
                 }
-    
+
                 vlc_object_release( (vlc_object_t *)p_vout );
             }
         }
index 6b89236..fb5d4c3 100644 (file)
@@ -71,8 +71,8 @@
     [o_btn_playlist setToolTip: _NS("Playlist")];
     [self setTitle: _NS("VLC media player")];
 
-    o_img_play = [NSImage imageNamed: @"play_big"];
-    o_img_pause = [NSImage imageNamed: @"pause_big"];
+    o_img_play = [NSImage imageNamed: @"play_embedded"];
+    o_img_pause = [NSImage imageNamed: @"pause_embedded"];
 
     [self controlTintChanged];
     [[NSNotificationCenter defaultCenter] addObserver: self
@@ -85,7 +85,7 @@
                                                                   green:0.843
                                                                    blue:0.886
                                                                   alpha:1.0]];
-    
+
     [self setMinSize:NSMakeSize([o_sidebar_list convertRect:[o_sidebar_list bounds]
                                                      toView: nil].size.width + 551., 114.)];
 
     BOOL b_playing = NO;
     if( [o_btn_play alternateImage] == o_img_play_pressed )
         b_playing = YES;
-    
-    o_img_play_pressed = [NSImage imageNamed: @"play_big_down"];
-    o_img_pause_pressed = [NSImage imageNamed: @"pause_big_down"];
-    
+
+    if( [NSColor currentControlTint] == NSGraphiteControlTint ) {
+        o_img_play_pressed = [NSImage imageNamed: @"play_embedded_graphite"];
+        o_img_pause_pressed = [NSImage imageNamed: @"pause_embedded_graphite"];
+    } else {
+        o_img_play_pressed = [NSImage imageNamed:@"play_embedded_blue"];
+        o_img_pause_pressed = [NSImage imageNamed:@"pause_embedded_blue"];
+    }
+
     if( b_playing )
         [o_btn_play setAlternateImage: o_img_play_pressed];
     else
     [o_img_play_pressed release];
     [o_img_pause release];
     [o_img_pause_pressed release];
-    
+
     [super dealloc];
 }
 
 {
     if( o_main_pgbar )
         return o_main_pgbar;
-    
+
     return nil;
 }
 
        if( newList.size.height < 50 && newList.size.height > 0 ) {
                [self togglePlaylist:self];
        }
-    
-    /* With no video open or with the playlist open the behavior is odd */    
+
+    /* With no video open or with the playlist open the behavior is odd */
     if( newList.size.height > 50 )
         return proposedFrameSize;
-       
+
     if( videoRatio.height == 0. || videoRatio.width == 0. )
         return proposedFrameSize;
 
     vout_thread_t *p_vout = getVout();
     BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" );
 
-    screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )]; 
+    screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )];
+
     [self lockFullscreenAnimation];
 
     if (!screen)
     [o_btn_fullscreen setState: YES];
 
     [NSCursor setHiddenUntilMouseMoves: YES];
-    if( blackout_other_displays )        
+
+    if( blackout_other_displays )
         [screen blackoutOtherScreens];
 
     /* Make sure we don't see the window flashes in float-on-top mode */
             /* We don't animate if we are not visible, instead we
              * simply fade the display */
             CGDisplayFadeReservationToken token;
+
             CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
             CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
+
             if ([screen isMainScreen])
                 SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+
             [[o_view superview] replaceSubview:o_view with:o_temp_view];
             [o_temp_view setFrame:[o_view frame]];
             [o_fullscreen_window setContentView:o_view];
 
             return;
         }
+
         /* Make sure we don't see the o_view disappearing of the screen during this operation */
         NSDisableScreenUpdates();
         [[o_view superview] replaceSubview:o_view with:o_temp_view];
         [o_fullscreen_anim2 stopAnimation];
         [o_fullscreen_anim2 release];
     }
+
     if ([screen isMainScreen])
         SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
 
     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:)];
-            
+
             for( i = 0; i < (int)[o_values count]; i++)
             {
                 NSDictionary *o_dic;