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 @@
CLASS = VLCMain;
LANGUAGE = ObjC;
OUTLETS = {
"o_btn_equalizer" = id;
"o_btn_ff" = id;
"o_btn_fullscreen" = id;
"o_btn_next" = id;
"o_btn_play" = id;
"o_btn_playlist" = id;
......
......@@ -9,7 +9,7 @@
<key>1617</key>
<string>788 586 109 149 0 0 1440 878 </string>
<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>
<string>305 626 508 82 0 0 1024 746 </string>
<key>2730</key>
......@@ -26,11 +26,12 @@
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
<integer>2769</integer>
<integer>2416</integer>
<integer>29</integer>
<integer>2197</integer>
<integer>1789</integer>
<integer>2769</integer>
<integer>2730</integer>
<integer>29</integer>
<integer>2416</integer>
</array>
<key>IBSystem Version</key>
<string>8S2167</string>
......
......@@ -5,7 +5,7 @@
<key>IBDocumentLocation</key>
<string>-8 61 505 517 0 0 800 578 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<string>489.0</string>
<key>IBLockedObjects</key>
<array>
<integer>2203</integer>
......
This diff is collapsed.
......@@ -33,13 +33,16 @@
{
IBOutlet id o_main;
IBOutlet id o_btn_fullscreen;
IBOutlet id o_volumeslider;
IBOutlet id o_btn_shuffle;
IBOutlet id o_btn_addNode;
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_enter_fld;
IBOutlet id o_specificTime_goTo_lbl;
......@@ -51,6 +54,7 @@
VLCFSPanel *o_fs_panel;
}
- (void)controlTintChanged;
- (IBAction)play:(id)sender;
- (IBAction)stop:(id)sender;
......
......@@ -59,6 +59,60 @@
[o_specificTime_ok_btn setTitle: _NS("OK")];
[o_specificTime_sec_lbl setStringValue: _NS("sec.")];
[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
......@@ -178,18 +232,18 @@
/* three little ugly helpers */
- (void)repeatOne
{
[o_btn_repeat setImage: [NSImage imageNamed:@"repeat_single_embedded_blue"]];
[o_btn_repeat setAlternateImage: [NSImage imageNamed:@"repeat_embedded_blue"]];
[o_btn_repeat setImage: o_repeat_single];
[o_btn_repeat setAlternateImage: o_repeat_all];
}
- (void)repeatAll
{
[o_btn_repeat setImage: [NSImage imageNamed:@"repeat_embedded_blue"]];
[o_btn_repeat setAlternateImage: [NSImage imageNamed:@"repeat_embedded"]];
[o_btn_repeat setImage: o_repeat_all];
[o_btn_repeat setAlternateImage: o_repeat_off];
}
- (void)repeatOff
{
[o_btn_repeat setImage: [NSImage imageNamed:@"repeat_embedded"]];
[o_btn_repeat setAlternateImage: [NSImage imageNamed:@"repeat_single_embedded_blue"]];
[o_btn_repeat setImage: o_repeat_off];
[o_btn_repeat setAlternateImage: o_repeat_single];
}
- (void)shuffle
{
......
......@@ -52,6 +52,8 @@
NSRecursiveLock * o_animation_lock;
}
- (void)controlTintChanged;
- (void)setTime: (NSString *)o_arg_ime position: (float)f_position;
- (void)playStatusUpdated: (int)i_status;
- (void)setSeekable: (BOOL)b_seekable;
......
......@@ -51,9 +51,12 @@
[o_slider setToolTip: _NS("Position")];
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_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 */
o_temp_view = [[NSView alloc] init];
......@@ -72,6 +75,39 @@
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
{
[o_time setStringValue: o_arg_time];
......
......@@ -133,6 +133,7 @@ struct intf_sys_t
IBOutlet id o_btn_next; /* btn next */
IBOutlet id o_btn_fullscreen;/* btn fullscreen (embedded vout window) */
IBOutlet id o_btn_playlist; /* btn playlist */
IBOutlet id o_btn_equalizer; /* eq btn */
NSImage * o_img_play; /* btn play img */
NSImage * o_img_pause; /* btn pause img */
......@@ -300,6 +301,8 @@ struct intf_sys_t
- (intf_thread_t *)getIntf;
- (void)setIntf:(intf_thread_t *)p_mainintf;
- (void)controlTintChanged;
- (id)getControls;
- (id)getPlaylist;
- (id)getInfo;
......
......@@ -545,9 +545,61 @@ static VLCMain *_o_sharedMainInstance = nil;
name: NSApplicationDidChangeScreenParametersNotification
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;
}
- (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
{
[o_window setTitle: _NS("VLC - Controller")];
......@@ -703,11 +755,6 @@ static VLCMain *_o_sharedMainInstance = nil;
o_msg_lock = [[NSLock alloc] init];
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];
[[NSRunLoop currentRunLoop]
addPort: p_intf->p_sys->o_sendport
......@@ -1683,12 +1730,11 @@ static VLCMain *_o_sharedMainInstance = nil;
var_DelCallback( p_intf, "interaction", InteractCallback, self );
/* remove global observer watching for vout device changes correctly */
[[NSNotificationCenter defaultCenter] removeObserver: self
name: NSApplicationDidChangeScreenParametersNotification
object: nil];
[[NSNotificationCenter defaultCenter] removeObserver: self];
/* 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 )
[o_about release];
......@@ -1722,7 +1768,7 @@ static VLCMain *_o_sharedMainInstance = 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 = nil;
......
......@@ -122,7 +122,7 @@
@end
/*****************************************************************************
* ITSliderCell
* ITSlider
*****************************************************************************/
@interface ITSlider : NSSlider
......@@ -141,5 +141,6 @@
NSImage *_knobOn;
BOOL b_mouse_down;
}
- (void)controlTintChanged;
@end
......@@ -635,14 +635,27 @@ void _drawFrameInRect(NSRect frameRect)
- (id)init
{
self = [super init];
_knobOff = [[NSImage imageNamed:@"volumeslider_normal"] retain];
_knobOn = [[NSImage imageNamed:@"volumeslider_blue"] retain];
_knobOff = [NSImage imageNamed:@"volumeslider_normal"];
[self controlTintChanged];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector( controlTintChanged )
name: NSControlTintDidChangeNotification
object: nil];
b_mouse_down = FALSE;
return self;
}
- (void)controlTintChanged
{
if( [NSColor currentControlTint] == NSGraphiteControlTint )
_knobOn = [NSImage imageNamed:@"volumeslider_graphite"];
else
_knobOn = [NSImage imageNamed:@"volumeslider_blue"];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[_knobOff release];
[_knobOn release];
[super dealloc];
......
......@@ -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.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
{
......@@ -1108,6 +1115,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
if( !s_frame )
{
msg_Warn( p_vout, "no frame found, centering vout" );
[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