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

* add a 'graphite' button set including the facilities to switch the theme at...

* add a 'graphite' button set including the facilities to switch the theme at runtime (closes #1379)
parent 15c25c42
...@@ -220,7 +220,9 @@ ...@@ -220,7 +220,9 @@
CLASS = VLCMain; CLASS = VLCMain;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = { OUTLETS = {
"o_btn_equalizer" = id;
"o_btn_ff" = id; "o_btn_ff" = id;
"o_btn_fullscreen" = id;
"o_btn_next" = id; "o_btn_next" = id;
"o_btn_play" = id; "o_btn_play" = id;
"o_btn_playlist" = id; "o_btn_playlist" = id;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<key>1617</key> <key>1617</key>
<string>788 586 109 149 0 0 1440 878 </string> <string>788 586 109 149 0 0 1440 878 </string>
<key>2197</key> <key>2197</key>
<string>422 532 596 143 0 0 1440 878 </string> <string>342 466 596 143 0 0 1280 778 </string>
<key>2709</key> <key>2709</key>
<string>305 626 508 82 0 0 1024 746 </string> <string>305 626 508 82 0 0 1024 746 </string>
<key>2730</key> <key>2730</key>
...@@ -26,11 +26,12 @@ ...@@ -26,11 +26,12 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>21</integer> <integer>21</integer>
<integer>2769</integer> <integer>2197</integer>
<integer>2416</integer>
<integer>29</integer>
<integer>1789</integer> <integer>1789</integer>
<integer>2769</integer>
<integer>2730</integer> <integer>2730</integer>
<integer>29</integer>
<integer>2416</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8S2167</string> <string>8S2167</string>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>-8 61 505 517 0 0 800 578 </string> <string>-8 61 505 517 0 0 800 578 </string>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>446.1</string> <string>489.0</string>
<key>IBLockedObjects</key> <key>IBLockedObjects</key>
<array> <array>
<integer>2203</integer> <integer>2203</integer>
......
This diff is collapsed.
...@@ -33,12 +33,15 @@ ...@@ -33,12 +33,15 @@
{ {
IBOutlet id o_main; IBOutlet id o_main;
IBOutlet id o_btn_fullscreen;
IBOutlet id o_volumeslider; IBOutlet id o_volumeslider;
IBOutlet id o_btn_shuffle; IBOutlet id o_btn_shuffle;
IBOutlet id o_btn_addNode; IBOutlet id o_btn_addNode;
IBOutlet id o_btn_repeat; IBOutlet id o_btn_repeat;
NSImage * o_repeat_single;
NSImage * o_repeat_all;
NSImage * o_repeat_off;
IBOutlet id o_specificTime_cancel_btn; IBOutlet id o_specificTime_cancel_btn;
IBOutlet id o_specificTime_enter_fld; IBOutlet id o_specificTime_enter_fld;
...@@ -51,6 +54,7 @@ ...@@ -51,6 +54,7 @@
VLCFSPanel *o_fs_panel; VLCFSPanel *o_fs_panel;
} }
- (void)controlTintChanged;
- (IBAction)play:(id)sender; - (IBAction)play:(id)sender;
- (IBAction)stop:(id)sender; - (IBAction)stop:(id)sender;
......
...@@ -59,6 +59,60 @@ ...@@ -59,6 +59,60 @@
[o_specificTime_ok_btn setTitle: _NS("OK")]; [o_specificTime_ok_btn setTitle: _NS("OK")];
[o_specificTime_sec_lbl setStringValue: _NS("sec.")]; [o_specificTime_sec_lbl setStringValue: _NS("sec.")];
[o_specificTime_goTo_lbl setStringValue: _NS("Jump to time")]; [o_specificTime_goTo_lbl setStringValue: _NS("Jump to time")];
o_repeat_off = [NSImage imageNamed:@"repeat_embedded"];
[self controlTintChanged];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector( controlTintChanged )
name: NSControlTintDidChangeNotification
object: nil];
}
- (void)controlTintChanged
{
int i_repeat = 0;
if( [o_btn_repeat image] == o_repeat_single )
i_repeat = 1;
else if( [o_btn_repeat image] == o_repeat_all )
i_repeat = 2;
if( [NSColor currentControlTint] == NSGraphiteControlTint )
{
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"]];
}
else
{
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];
else if( i_repeat == 2 )
[self repeatAll];
else
[self repeatOff];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[o_repeat_single release];
[o_repeat_all release];
[o_repeat_off release];
[super dealloc];
} }
- (IBAction)play:(id)sender - (IBAction)play:(id)sender
...@@ -178,18 +232,18 @@ ...@@ -178,18 +232,18 @@
/* three little ugly helpers */ /* three little ugly helpers */
- (void)repeatOne - (void)repeatOne
{ {
[o_btn_repeat setImage: [NSImage imageNamed:@"repeat_single_embedded_blue"]]; [o_btn_repeat setImage: o_repeat_single];
[o_btn_repeat setAlternateImage: [NSImage imageNamed:@"repeat_embedded_blue"]]; [o_btn_repeat setAlternateImage: o_repeat_all];
} }
- (void)repeatAll - (void)repeatAll
{ {
[o_btn_repeat setImage: [NSImage imageNamed:@"repeat_embedded_blue"]]; [o_btn_repeat setImage: o_repeat_all];
[o_btn_repeat setAlternateImage: [NSImage imageNamed:@"repeat_embedded"]]; [o_btn_repeat setAlternateImage: o_repeat_off];
} }
- (void)repeatOff - (void)repeatOff
{ {
[o_btn_repeat setImage: [NSImage imageNamed:@"repeat_embedded"]]; [o_btn_repeat setImage: o_repeat_off];
[o_btn_repeat setAlternateImage: [NSImage imageNamed:@"repeat_single_embedded_blue"]]; [o_btn_repeat setAlternateImage: o_repeat_single];
} }
- (void)shuffle - (void)shuffle
{ {
......
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
NSRecursiveLock * o_animation_lock; NSRecursiveLock * o_animation_lock;
} }
- (void)controlTintChanged;
- (void)setTime: (NSString *)o_arg_ime position: (float)f_position; - (void)setTime: (NSString *)o_arg_ime position: (float)f_position;
- (void)playStatusUpdated: (int)i_status; - (void)playStatusUpdated: (int)i_status;
- (void)setSeekable: (BOOL)b_seekable; - (void)setSeekable: (BOOL)b_seekable;
......
...@@ -51,9 +51,12 @@ ...@@ -51,9 +51,12 @@
[o_slider setToolTip: _NS("Position")]; [o_slider setToolTip: _NS("Position")];
o_img_play = [NSImage imageNamed: @"play_embedded"]; o_img_play = [NSImage imageNamed: @"play_embedded"];
o_img_play_pressed = [NSImage imageNamed: @"play_embedded_blue"];
o_img_pause = [NSImage imageNamed: @"pause_embedded"]; o_img_pause = [NSImage imageNamed: @"pause_embedded"];
o_img_pause_pressed = [NSImage imageNamed: @"pause_embedded_blue"]; [self controlTintChanged];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector( controlTintChanged )
name: NSControlTintDidChangeNotification
object: nil];
/* Useful to save o_view frame in fullscreen mode */ /* Useful to save o_view frame in fullscreen mode */
o_temp_view = [[NSView alloc] init]; o_temp_view = [[NSView alloc] init];
...@@ -72,6 +75,39 @@ ...@@ -72,6 +75,39 @@
b_animation_lock_alreadylocked = NO; b_animation_lock_alreadylocked = NO;
} }
- (void)controlTintChanged
{
if( [NSColor currentControlTint] == NSGraphiteControlTint )
{
o_img_play_pressed = [NSImage imageNamed: @"play_embedded_graphite"];
o_img_pause_pressed = [NSImage imageNamed: @"pause_embedded_graphite"];
[o_btn_backward setAlternateImage: [NSImage imageNamed: @"skip_previous_embedded_graphite"]];
[o_btn_forward setAlternateImage: [NSImage imageNamed: @"skip_forward_embedded_graphite"]];
[o_btn_play setAlternateImage: o_img_play_pressed];
[o_btn_fullscreen setAlternateImage: [NSImage imageNamed: @"fullscreen_graphite"]];
}
else
{
o_img_play_pressed = [NSImage imageNamed: @"play_embedded_blue"];
o_img_pause_pressed = [NSImage imageNamed: @"pause_embedded_blue"];
[o_btn_backward setAlternateImage: [NSImage imageNamed: @"skip_previous_embedded_blue"]];
[o_btn_forward setAlternateImage: [NSImage imageNamed: @"skip_forward_embedded_blue"]];
[o_btn_play setAlternateImage: o_img_play_pressed];
[o_btn_fullscreen setAlternateImage: [NSImage imageNamed: @"fullscreen_blue"]];
}
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[o_img_play release];
[o_img_play_pressed release];
[o_img_pause release];
[o_img_pause_pressed release];
[super dealloc];
}
- (void)setTime:(NSString *)o_arg_time position:(float)f_position - (void)setTime:(NSString *)o_arg_time position:(float)f_position
{ {
[o_time setStringValue: o_arg_time]; [o_time setStringValue: o_arg_time];
......
...@@ -133,6 +133,7 @@ struct intf_sys_t ...@@ -133,6 +133,7 @@ struct intf_sys_t
IBOutlet id o_btn_next; /* btn next */ IBOutlet id o_btn_next; /* btn next */
IBOutlet id o_btn_fullscreen;/* btn fullscreen (embedded vout window) */ IBOutlet id o_btn_fullscreen;/* btn fullscreen (embedded vout window) */
IBOutlet id o_btn_playlist; /* btn playlist */ IBOutlet id o_btn_playlist; /* btn playlist */
IBOutlet id o_btn_equalizer; /* eq btn */
NSImage * o_img_play; /* btn play img */ NSImage * o_img_play; /* btn play img */
NSImage * o_img_pause; /* btn pause img */ NSImage * o_img_pause; /* btn pause img */
...@@ -300,6 +301,8 @@ struct intf_sys_t ...@@ -300,6 +301,8 @@ struct intf_sys_t
- (intf_thread_t *)getIntf; - (intf_thread_t *)getIntf;
- (void)setIntf:(intf_thread_t *)p_mainintf; - (void)setIntf:(intf_thread_t *)p_mainintf;
- (void)controlTintChanged;
- (id)getControls; - (id)getControls;
- (id)getPlaylist; - (id)getPlaylist;
- (id)getInfo; - (id)getInfo;
......
...@@ -544,10 +544,62 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -544,10 +544,62 @@ static VLCMain *_o_sharedMainInstance = nil;
selector: @selector(refreshVoutDeviceMenu:) selector: @selector(refreshVoutDeviceMenu:)
name: NSApplicationDidChangeScreenParametersNotification name: NSApplicationDidChangeScreenParametersNotification
object: nil]; object: nil];
o_img_play = [NSImage imageNamed: @"play"];
o_img_pause = [NSImage imageNamed: @"pause"];
[self controlTintChanged];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector( controlTintChanged )
name: NSControlTintDidChangeNotification
object: nil];
nib_main_loaded = TRUE; nib_main_loaded = TRUE;
} }
- (void)controlTintChanged
{
BOOL b_playing = NO;
if( [o_btn_play image] == o_img_play_pressed )
b_playing = YES;
if( [NSColor currentControlTint] == NSGraphiteControlTint )
{
o_img_play_pressed = [NSImage imageNamed: @"play_graphite"];
o_img_pause_pressed = [NSImage imageNamed: @"pause_graphite"];
[o_btn_prev setAlternateImage: [NSImage imageNamed: @"previous_graphite"]];
[o_btn_rewind setAlternateImage: [NSImage imageNamed: @"skip_previous_graphite"]];
[o_btn_stop setAlternateImage: [NSImage imageNamed: @"stop_graphite"]];
[o_btn_ff setAlternateImage: [NSImage imageNamed: @"skip_forward_graphite"]];
[o_btn_next setAlternateImage: [NSImage imageNamed: @"next_graphite"]];
[o_btn_fullscreen setAlternateImage: [NSImage imageNamed: @"fullscreen_graphite"]];
[o_btn_playlist setAlternateImage: [NSImage imageNamed: @"playlistdrawer_graphite"]];
[o_btn_equalizer setAlternateImage: [NSImage imageNamed: @"equalizerdrawer_graphite"]];
}
else
{
o_img_play_pressed = [NSImage imageNamed: @"play_blue"];
o_img_pause_pressed = [NSImage imageNamed: @"pause_blue"];
[o_btn_prev setAlternateImage: [NSImage imageNamed: @"previous_blue"]];
[o_btn_rewind setAlternateImage: [NSImage imageNamed: @"skip_previous_blue"]];
[o_btn_stop setAlternateImage: [NSImage imageNamed: @"stop_blue"]];
[o_btn_ff setAlternateImage: [NSImage imageNamed: @"skip_forward_blue"]];
[o_btn_next setAlternateImage: [NSImage imageNamed: @"next_blue"]];
[o_btn_fullscreen setAlternateImage: [NSImage imageNamed: @"fullscreen_blue"]];
[o_btn_playlist setAlternateImage: [NSImage imageNamed: @"playlistdrawer_blue"]];
[o_btn_equalizer setAlternateImage: [NSImage imageNamed: @"equalizerdrawer_blue"]];
}
if( b_playing )
[o_btn_play setImage: o_img_play_pressed];
else
[o_btn_play setImage: o_img_pause_pressed];
}
- (void)initStrings - (void)initStrings
{ {
[o_window setTitle: _NS("VLC - Controller")]; [o_window setTitle: _NS("VLC - Controller")];
...@@ -703,11 +755,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -703,11 +755,6 @@ static VLCMain *_o_sharedMainInstance = nil;
o_msg_lock = [[NSLock alloc] init]; o_msg_lock = [[NSLock alloc] init];
o_msg_arr = [[NSMutableArray arrayWithCapacity: 200] retain]; o_msg_arr = [[NSMutableArray arrayWithCapacity: 200] retain];
o_img_play = [[NSImage imageNamed: @"play"] retain];
o_img_play_pressed = [[NSImage imageNamed: @"play_blue"] retain];
o_img_pause = [[NSImage imageNamed: @"pause"] retain];
o_img_pause_pressed = [[NSImage imageNamed: @"pause_blue"] retain];
[p_intf->p_sys->o_sendport setDelegate: self]; [p_intf->p_sys->o_sendport setDelegate: self];
[[NSRunLoop currentRunLoop] [[NSRunLoop currentRunLoop]
addPort: p_intf->p_sys->o_sendport addPort: p_intf->p_sys->o_sendport
...@@ -1683,12 +1730,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1683,12 +1730,11 @@ static VLCMain *_o_sharedMainInstance = nil;
var_DelCallback( p_intf, "interaction", InteractCallback, self ); var_DelCallback( p_intf, "interaction", InteractCallback, self );
/* remove global observer watching for vout device changes correctly */ /* remove global observer watching for vout device changes correctly */
[[NSNotificationCenter defaultCenter] removeObserver: self [[NSNotificationCenter defaultCenter] removeObserver: self];
name: NSApplicationDidChangeScreenParametersNotification
object: nil];
/* release some other objects here, because it isn't sure whether dealloc /* release some other objects here, because it isn't sure whether dealloc
* will be called later on -- FK (10/6/05) */ * will be called later on */
if( nib_about_loaded && o_about ) if( nib_about_loaded && o_about )
[o_about release]; [o_about release];
...@@ -1722,7 +1768,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1722,7 +1768,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_img_pause_pressed = nil; o_img_pause_pressed = nil;
} }
if( o_img_pause_pressed != nil ) if( o_img_play_pressed != nil )
{ {
[o_img_pause_pressed release]; [o_img_pause_pressed release];
o_img_pause_pressed = nil; o_img_pause_pressed = nil;
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
@end @end
/***************************************************************************** /*****************************************************************************
* ITSliderCell * ITSlider
*****************************************************************************/ *****************************************************************************/
@interface ITSlider : NSSlider @interface ITSlider : NSSlider
...@@ -141,5 +141,6 @@ ...@@ -141,5 +141,6 @@
NSImage *_knobOn; NSImage *_knobOn;
BOOL b_mouse_down; BOOL b_mouse_down;
} }
- (void)controlTintChanged;
@end @end
...@@ -635,14 +635,27 @@ void _drawFrameInRect(NSRect frameRect) ...@@ -635,14 +635,27 @@ void _drawFrameInRect(NSRect frameRect)
- (id)init - (id)init
{ {
self = [super init]; self = [super init];
_knobOff = [[NSImage imageNamed:@"volumeslider_normal"] retain]; _knobOff = [NSImage imageNamed:@"volumeslider_normal"];
_knobOn = [[NSImage imageNamed:@"volumeslider_blue"] retain]; [self controlTintChanged];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector( controlTintChanged )
name: NSControlTintDidChangeNotification
object: nil];
b_mouse_down = FALSE; b_mouse_down = FALSE;
return self; return self;
} }
- (void)controlTintChanged
{
if( [NSColor currentControlTint] == NSGraphiteControlTint )
_knobOn = [NSImage imageNamed:@"volumeslider_graphite"];
else
_knobOn = [NSImage imageNamed:@"volumeslider_blue"];
}
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver: self];
[_knobOff release]; [_knobOff release];
[_knobOn release]; [_knobOn release];
[super dealloc]; [super dealloc];
......
...@@ -1093,6 +1093,13 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -1093,6 +1093,13 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
{ {
s_rect.size.width = p_vout->i_window_width; s_rect.size.width = p_vout->i_window_width;
s_rect.size.height = p_vout->i_window_height; s_rect.size.height = p_vout->i_window_height;
/* go to our default position, if set */
if( var_GetInteger( p_vout, "video-x" ) > -1 )
s_rect.origin.x = var_GetInteger( p_vout, "video-x" );
if( var_GetInteger( p_vout, "video-y" ) > -1 )
s_rect.origin.y = var_GetInteger( p_vout, "video-y" );
msg_Dbg( p_vout, "vout will open at %i:%i", s_rect.origin.x, s_rect.origin.y );
} }
else else
{ {
...@@ -1108,6 +1115,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -1108,6 +1115,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
if( !s_frame ) if( !s_frame )
{ {
msg_Warn( p_vout, "no frame found, centering vout" );
[self center]; [self center];
} }
} }
......
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