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

* animate vout-window resizements. Patch by Pierre d'Herbement <pdherbement...

* animate vout-window resizements. Patch by Pierre d'Herbement <pdherbement --at,chez-- free.fr>. Thanks!
parent 98736d8e
......@@ -67,9 +67,8 @@
"o_btn_play" = id;
"o_slider" = id;
"o_time" = id;
"o_window" = id;
};
SUPERCLASS = NSObject;
SUPERCLASS = NSWindow;
},
{
ACTIONS = {
......
......@@ -13,9 +13,9 @@
<key>2709</key>
<string>305 626 508 82 0 0 1024 746 </string>
<key>2730</key>
<string>396 512 130 249 0 0 1440 878 </string>
<string>348 431 130 249 0 0 1280 778 </string>
<key>29</key>
<string>130 802 438 44 0 0 1440 878 </string>
<string>109 706 438 44 0 0 1280 778 </string>
<key>915</key>
<string>777 479 187 249 0 0 1440 878 </string>
</dict>
......@@ -25,14 +25,13 @@
<array/>
<key>IBOpenObjects</key>
<array>
<integer>2416</integer>
<integer>29</integer>
<integer>21</integer>
<integer>2769</integer>
<integer>2730</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>8L127</string>
<string>8L2127</string>
<key>IBUsesTextArchiving</key>
<true/>
</dict>
......
......@@ -422,11 +422,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 = pl_Yield( VLCIntf );
......
......@@ -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;
......
......@@ -316,7 +316,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;
......@@ -355,7 +355,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;
}
......@@ -877,7 +877,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