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

* back-port Pierre d'Herbemont's patch to animate vout-window resizing...

* back-port Pierre d'Herbemont's patch to animate vout-window resizing [18882]. the nib file was manually adapted by myself as the patch failed. I hope that I got everything. It works right now :)
parent 4ec93a1c
......@@ -67,9 +67,8 @@
"o_btn_play" = id;
"o_slider" = id;
"o_time" = id;
"o_window" = id;
};
SUPERCLASS = NSObject;
SUPERCLASS = NSWindow;
},
{
ACTIONS = {
......
......@@ -25,9 +25,10 @@
<array/>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
<integer>2809</integer>
<integer>29</integer>
<integer>2809</integer>
<integer>2416</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>8L127</string>
......
......@@ -423,11 +423,11 @@
if( o_vout_view )
{
if( [o_title isEqualToString: _NS("Half Size") ] )
[o_vout_view scaleWindowWithFactor: 0.5];
[o_vout_view scaleWindowWithFactor: 0.5 animate: YES];
else if( [o_title isEqualToString: _NS("Normal Size") ] )
[o_vout_view scaleWindowWithFactor: 1.0];
[o_vout_view scaleWindowWithFactor: 1.0 animate: YES];
else if( [o_title isEqualToString: _NS("Double Size") ] )
[o_vout_view scaleWindowWithFactor: 2.0];
[o_vout_view scaleWindowWithFactor: 2.0 animate: YES];
else if( [o_title isEqualToString: _NS("Float on Top") ] )
[o_vout_view toggleFloatOnTop];
else if( [o_title isEqualToString: _NS("Fit to Screen") ] )
......
......@@ -26,7 +26,7 @@
*****************************************************************************/
@interface VLCEmbeddedWindow : NSObject
@interface VLCEmbeddedWindow : NSWindow
{
IBOutlet id o_btn_backward;
IBOutlet id o_btn_forward;
......@@ -34,12 +34,13 @@
IBOutlet id o_btn_play;
IBOutlet id o_slider;
IBOutlet id o_time;
IBOutlet id o_window;
NSImage * o_img_play;
NSImage * o_img_play_pressed;
NSImage * o_img_pause;
NSImage * o_img_pause_pressed;
NSRect o_saved_frame;
}
- (void)setTime:(NSString *)o_arg_ime position:(float)f_position;
......
......@@ -37,7 +37,7 @@
- (void)awakeFromNib
{
[o_window setDelegate: self];
[self setDelegate: self];
[o_btn_backward setToolTip: _NS("Rewind")];
[o_btn_forward setToolTip: _NS("Fast Forward")];
......@@ -49,6 +49,8 @@
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"];
o_saved_frame = NSMakeRect( 0.0f, 0.0f, 0.0f, 0.0f );
}
- (void)setTime:(NSString *)o_arg_time position:(float)f_position
......@@ -85,6 +87,26 @@
[o_btn_fullscreen setState: b_fullscreen];
}
- (void)zoom:(id)sender
{
if( ![self isZoomed] )
{
NSRect zoomRect = [[self screen] frame];
o_saved_frame = [self frame];
/* we don't have to take care of the eventual menu bar and dock
as zoomRect will be cropped automatically by setFrame:display:
to the right rectangle */
[self setFrame: zoomRect display: YES animate: YES];
}
else
{
/* unzoom to the saved_frame if the o_saved_frame coords look sound
(just in case) */
if( o_saved_frame.size.width > 0 && o_saved_frame.size.height > 0 )
[self setFrame: o_saved_frame display: YES animate: YES];
}
}
- (BOOL)windowShouldClose:(id)sender
{
playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
......
......@@ -58,7 +58,7 @@
- (void)closeVout;
- (void)updateTitle;
- (void)manage;
- (void)scaleWindowWithFactor: (float)factor;
- (void)scaleWindowWithFactor: (float)factor animate: (BOOL)animate;
- (void)setOnTop:(BOOL)b_on_top;
- (void)toggleFloatOnTop;
- (void)toggleFullscreen;
......
......@@ -305,7 +305,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
}
}
- (void)scaleWindowWithFactor: (float)factor
- (void)scaleWindowWithFactor: (float)factor animate: (BOOL)animate
{
NSSize newsize;
int i_corrected_height, i_corrected_width;
......@@ -344,7 +344,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
new_frame.origin.x = topleftscreen.x;
new_frame.origin.y = topleftscreen.y - new_frame.size.height;
[o_window setFrame: new_frame display: NO];
[o_window setFrame: new_frame display: animate animate: animate];
p_vout->i_changes |= VOUT_SIZE_CHANGE;
}
......@@ -863,7 +863,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
{
[o_window setAlphaValue: var_GetFloat( p_vout, "macosx-opaqueness" )];
[self updateTitle];
[self scaleWindowWithFactor: 1.0];
[self scaleWindowWithFactor: 1.0 animate: NO];
[o_window makeKeyAndOrderFront: self];
}
return b_return;
......
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