Commit c68b8101 authored by Felix Paul Kühne's avatar Felix Paul Kühne

legacy macosx intf: make sure we display the right playback button graphic...

legacy macosx intf: make sure we display the right playback button graphic when drawing the video window
parent eaf80712
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
{ {
o_repeat_single = [NSImage imageNamed:@"repeat_single_embedded_graphite"]; o_repeat_single = [NSImage imageNamed:@"repeat_single_embedded_graphite"];
o_repeat_all = [NSImage imageNamed:@"repeat_embedded_graphite"]; o_repeat_all = [NSImage imageNamed:@"repeat_embedded_graphite"];
[o_btn_shuffle setAlternateImage: [NSImage imageNamed: @"shuffle_embedded_graphite"]]; [o_btn_shuffle setAlternateImage: [NSImage imageNamed: @"shuffle_embedded_graphite"]];
[o_btn_addNode setAlternateImage: [NSImage imageNamed: @"add_embedded_graphite"]]; [o_btn_addNode setAlternateImage: [NSImage imageNamed: @"add_embedded_graphite"]];
} }
...@@ -92,11 +92,11 @@ ...@@ -92,11 +92,11 @@
{ {
o_repeat_single = [NSImage imageNamed:@"repeat_single_embedded_blue"]; o_repeat_single = [NSImage imageNamed:@"repeat_single_embedded_blue"];
o_repeat_all = [NSImage imageNamed:@"repeat_embedded_blue"]; o_repeat_all = [NSImage imageNamed:@"repeat_embedded_blue"];
[o_btn_shuffle setAlternateImage: [NSImage imageNamed: @"shuffle_embedded_blue"]]; [o_btn_shuffle setAlternateImage: [NSImage imageNamed: @"shuffle_embedded_blue"]];
[o_btn_addNode setAlternateImage: [NSImage imageNamed: @"add_embedded_blue"]]; [o_btn_addNode setAlternateImage: [NSImage imageNamed: @"add_embedded_blue"]];
} }
/* update the repeat button, but keep its state */ /* update the repeat button, but keep its state */
if( i_repeat == 1 ) if( i_repeat == 1 )
[self repeatOne]; [self repeatOne];
...@@ -109,12 +109,12 @@ ...@@ -109,12 +109,12 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver: self]; [[NSNotificationCenter defaultCenter] removeObserver: self];
[o_fs_panel release]; [o_fs_panel release];
[o_repeat_single release]; [o_repeat_single release];
[o_repeat_all release]; [o_repeat_all release];
[o_repeat_off release]; [o_repeat_off release];
[super dealloc]; [super dealloc];
} }
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
if(val.b_bool) if(val.b_bool)
[o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffleOn"]]; [o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffleOn"]];
else else
[o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffle"]]; [o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffle"]];
} }
- (IBAction)repeatButtonAction:(id)sender - (IBAction)repeatButtonAction:(id)sender
...@@ -267,48 +267,48 @@ ...@@ -267,48 +267,48 @@
if( !repeating.b_bool && !looping.b_bool ) if( !repeating.b_bool && !looping.b_bool )
{ {
/* was: no repeating at all, switching to Repeat One */ /* was: no repeating at all, switching to Repeat One */
/* set our button's look */ /* set our button's look */
[self repeatOne]; [self repeatOne];
/* prepare core communication */ /* prepare core communication */
repeating.b_bool = true; repeating.b_bool = true;
looping.b_bool = false; looping.b_bool = false;
config_PutInt( p_playlist, "repeat", 1 ); config_PutInt( p_playlist, "repeat", 1 );
config_PutInt( p_playlist, "loop", 0 ); config_PutInt( p_playlist, "loop", 0 );
/* show the change */ /* show the change */
vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat One" ) ); vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat One" ) );
} }
else if( repeating.b_bool && !looping.b_bool ) else if( repeating.b_bool && !looping.b_bool )
{ {
/* was: Repeat One, switching to Repeat All */ /* was: Repeat One, switching to Repeat All */
/* set our button's look */ /* set our button's look */
[self repeatAll]; [self repeatAll];
/* prepare core communication */ /* prepare core communication */
repeating.b_bool = false; repeating.b_bool = false;
looping.b_bool = true; looping.b_bool = true;
config_PutInt( p_playlist, "repeat", 0 ); config_PutInt( p_playlist, "repeat", 0 );
config_PutInt( p_playlist, "loop", 1 ); config_PutInt( p_playlist, "loop", 1 );
/* show the change */ /* show the change */
vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat All" ) ); vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat All" ) );
} }
else else
{ {
/* was: Repeat All or bug in VLC, switching to Repeat Off */ /* was: Repeat All or bug in VLC, switching to Repeat Off */
/* set our button's look */ /* set our button's look */
[self repeatOff]; [self repeatOff];
/* prepare core communication */ /* prepare core communication */
repeating.b_bool = false; repeating.b_bool = false;
looping.b_bool = false; looping.b_bool = false;
config_PutInt( p_playlist, "repeat", 0 ); config_PutInt( p_playlist, "repeat", 0 );
config_PutInt( p_playlist, "loop", 0 ); config_PutInt( p_playlist, "loop", 0 );
/* show the change */ /* show the change */
vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat Off" ) ); vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat Off" ) );
} }
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat Off" ) ); vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _( "Repeat Off" ) );
config_PutInt( p_playlist, "repeat", 0 ); config_PutInt( p_playlist, "repeat", 0 );
} }
p_intf->p_sys->b_playmode_update = true; p_intf->p_sys->b_playmode_update = true;
p_intf->p_sys->b_intf_update = true; p_intf->p_sys->b_intf_update = true;
} }
...@@ -591,7 +591,7 @@ ...@@ -591,7 +591,7 @@
{ {
NSUInteger c = 0; NSUInteger c = 0;
if( !p_input ) return; if( !p_input ) return;
c = [[openPanel filenames] count]; c = [[openPanel filenames] count];
for (int i = 0; i < [[openPanel filenames] count] ; i++) for (int i = 0; i < [[openPanel filenames] count] ; i++)
...@@ -690,7 +690,7 @@ ...@@ -690,7 +690,7 @@
/* Variable doesn't exist or isn't handled */ /* Variable doesn't exist or isn't handled */
return; return;
} }
/* Make sure we want to display the variable */ /* Make sure we want to display the variable */
if( i_type & VLC_VAR_HASCHOICE ) if( i_type & VLC_VAR_HASCHOICE )
{ {
...@@ -699,7 +699,7 @@ ...@@ -699,7 +699,7 @@
if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 ) if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 )
return; return;
} }
/* Get the descriptive name of the variable */ /* Get the descriptive name of the variable */
var_Change( p_object, psz_variable, VLC_VAR_GETTEXT, &text, NULL ); var_Change( p_object, psz_variable, VLC_VAR_GETTEXT, &text, NULL );
[o_mi setTitle: [[VLCMain sharedInstance] localizedString: text.psz_string ? [o_mi setTitle: [[VLCMain sharedInstance] localizedString: text.psz_string ?
...@@ -711,7 +711,7 @@ ...@@ -711,7 +711,7 @@
[self setupVarMenu: o_menu forMenuItem: o_mi target:p_object [self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
var:psz_variable selector:pf_callback]; var:psz_variable selector:pf_callback];
free( text.psz_string ); free( text.psz_string );
return; return;
} }
...@@ -1091,7 +1091,7 @@ ...@@ -1091,7 +1091,7 @@
NSArray *o_windows = [NSApp orderedWindows]; NSArray *o_windows = [NSApp orderedWindows];
NSEnumerator *o_enumerator = [o_windows objectEnumerator]; NSEnumerator *o_enumerator = [o_windows objectEnumerator];
bEnabled = FALSE; bEnabled = FALSE;
if( p_input != NULL ) if( p_input != NULL )
{ {
vout_thread_t *p_vout = input_GetVout( p_input ); vout_thread_t *p_vout = input_GetVout( p_input );
...@@ -1102,7 +1102,7 @@ ...@@ -1102,7 +1102,7 @@
var_Get( p_vout, "video-on-top", &val ); var_Get( p_vout, "video-on-top", &val );
[o_mi setState: val.b_bool ? NSOnState : NSOffState]; [o_mi setState: val.b_bool ? NSOnState : NSOffState];
} }
while( (o_window = [o_enumerator nextObject])) while( (o_window = [o_enumerator nextObject]))
{ {
if( [[o_window className] isEqualToString: @"VLCVoutWindow"] || if( [[o_window className] isEqualToString: @"VLCVoutWindow"] ||
...@@ -1113,7 +1113,7 @@ ...@@ -1113,7 +1113,7 @@
break; break;
} }
} }
vlc_object_release( (vlc_object_t *)p_vout ); vlc_object_release( (vlc_object_t *)p_vout );
} }
} }
......
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
[o_btn_playlist setToolTip: _NS("Playlist")]; [o_btn_playlist setToolTip: _NS("Playlist")];
[self setTitle: _NS("VLC media player")]; [self setTitle: _NS("VLC media player")];
o_img_play = [NSImage imageNamed: @"play_big"]; o_img_play = [NSImage imageNamed: @"play_embedded"];
o_img_pause = [NSImage imageNamed: @"pause_big"]; o_img_pause = [NSImage imageNamed: @"pause_embedded"];
[self controlTintChanged]; [self controlTintChanged];
[[NSNotificationCenter defaultCenter] addObserver: self [[NSNotificationCenter defaultCenter] addObserver: self
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
green:0.843 green:0.843
blue:0.886 blue:0.886
alpha:1.0]]; alpha:1.0]];
[self setMinSize:NSMakeSize([o_sidebar_list convertRect:[o_sidebar_list bounds] [self setMinSize:NSMakeSize([o_sidebar_list convertRect:[o_sidebar_list bounds]
toView: nil].size.width + 551., 114.)]; toView: nil].size.width + 551., 114.)];
...@@ -111,10 +111,15 @@ ...@@ -111,10 +111,15 @@
BOOL b_playing = NO; BOOL b_playing = NO;
if( [o_btn_play alternateImage] == o_img_play_pressed ) if( [o_btn_play alternateImage] == o_img_play_pressed )
b_playing = YES; b_playing = YES;
o_img_play_pressed = [NSImage imageNamed: @"play_big_down"]; if( [NSColor currentControlTint] == NSGraphiteControlTint ) {
o_img_pause_pressed = [NSImage imageNamed: @"pause_big_down"]; 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 ) if( b_playing )
[o_btn_play setAlternateImage: o_img_play_pressed]; [o_btn_play setAlternateImage: o_img_play_pressed];
else else
...@@ -128,7 +133,7 @@ ...@@ -128,7 +133,7 @@
[o_img_play_pressed release]; [o_img_play_pressed release];
[o_img_pause release]; [o_img_pause release];
[o_img_pause_pressed release]; [o_img_pause_pressed release];
[super dealloc]; [super dealloc];
} }
...@@ -170,7 +175,7 @@ ...@@ -170,7 +175,7 @@
{ {
if( o_main_pgbar ) if( o_main_pgbar )
return o_main_pgbar; return o_main_pgbar;
return nil; return nil;
} }
...@@ -235,11 +240,11 @@ ...@@ -235,11 +240,11 @@
if( newList.size.height < 50 && newList.size.height > 0 ) { if( newList.size.height < 50 && newList.size.height > 0 ) {
[self togglePlaylist:self]; [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 ) if( newList.size.height > 50 )
return proposedFrameSize; return proposedFrameSize;
if( videoRatio.height == 0. || videoRatio.width == 0. ) if( videoRatio.height == 0. || videoRatio.width == 0. )
return proposedFrameSize; return proposedFrameSize;
...@@ -392,8 +397,8 @@ ...@@ -392,8 +397,8 @@
vout_thread_t *p_vout = getVout(); vout_thread_t *p_vout = getVout();
BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" ); 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]; [self lockFullscreenAnimation];
if (!screen) if (!screen)
...@@ -414,8 +419,8 @@ ...@@ -414,8 +419,8 @@
[o_btn_fullscreen setState: YES]; [o_btn_fullscreen setState: YES];
[NSCursor setHiddenUntilMouseMoves: YES]; [NSCursor setHiddenUntilMouseMoves: YES];
if( blackout_other_displays ) if( blackout_other_displays )
[screen blackoutOtherScreens]; [screen blackoutOtherScreens];
/* Make sure we don't see the window flashes in float-on-top mode */ /* Make sure we don't see the window flashes in float-on-top mode */
...@@ -439,13 +444,13 @@ ...@@ -439,13 +444,13 @@
/* We don't animate if we are not visible, instead we /* We don't animate if we are not visible, instead we
* simply fade the display */ * simply fade the display */
CGDisplayFadeReservationToken token; CGDisplayFadeReservationToken token;
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token); CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
if ([screen isMainScreen]) if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
[[o_view superview] replaceSubview:o_view with:o_temp_view]; [[o_view superview] replaceSubview:o_view with:o_temp_view];
[o_temp_view setFrame:[o_view frame]]; [o_temp_view setFrame:[o_view frame]];
[o_fullscreen_window setContentView:o_view]; [o_fullscreen_window setContentView:o_view];
...@@ -465,7 +470,7 @@ ...@@ -465,7 +470,7 @@
return; return;
} }
/* Make sure we don't see the o_view disappearing of the screen during this operation */ /* Make sure we don't see the o_view disappearing of the screen during this operation */
NSDisableScreenUpdates(); NSDisableScreenUpdates();
[[o_view superview] replaceSubview:o_view with:o_temp_view]; [[o_view superview] replaceSubview:o_view with:o_temp_view];
...@@ -494,7 +499,7 @@ ...@@ -494,7 +499,7 @@
[o_fullscreen_anim2 stopAnimation]; [o_fullscreen_anim2 stopAnimation];
[o_fullscreen_anim2 release]; [o_fullscreen_anim2 release];
} }
if ([screen isMainScreen]) if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
...@@ -854,7 +859,7 @@ ...@@ -854,7 +859,7 @@
NSString *o_desired_type = [o_paste availableTypeFromArray:o_types]; NSString *o_desired_type = [o_paste availableTypeFromArray:o_types];
NSData *o_carried_data = [o_paste dataForType:o_desired_type]; NSData *o_carried_data = [o_paste dataForType:o_desired_type];
BOOL b_autoplay = config_GetInt( VLCIntf, "macosx-autoplay" ); BOOL b_autoplay = config_GetInt( VLCIntf, "macosx-autoplay" );
if( o_carried_data ) if( o_carried_data )
{ {
if ([o_desired_type isEqualToString:NSFilenamesPboardType]) if ([o_desired_type isEqualToString:NSFilenamesPboardType])
...@@ -863,7 +868,7 @@ ...@@ -863,7 +868,7 @@
NSArray *o_array = [NSArray array]; NSArray *o_array = [NSArray array];
NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType]
sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
for( i = 0; i < (int)[o_values count]; i++) for( i = 0; i < (int)[o_values count]; i++)
{ {
NSDictionary *o_dic; NSDictionary *o_dic;
......
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