Commit 84bfb7f2 authored by hartman's avatar hartman
Browse files

* Resize window fixes

  - we should not resize the window in fullscreen
  - fixed the black bars bug in half and double size
  - position of top left corner should not change
  - more efficient code
parent c25947e7
......@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: controls.m,v 1.20 2003/02/07 20:23:17 hartman Exp $
* $Id: controls.m,v 1.21 2003/02/07 21:30:25 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -380,7 +380,7 @@
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
{
[o_window halfWindow];
[o_window scaleWindowWithFactor: 0.5];
}
}
}
......@@ -395,7 +395,7 @@
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
{
[o_window normalWindow];
[o_window scaleWindowWithFactor: 1];
}
}
}
......@@ -410,7 +410,7 @@
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
{
[o_window doubleWindow];
[o_window scaleWindowWithFactor: 2];
}
}
}
......
......@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: vout.h,v 1.6 2003/02/07 20:23:17 hartman Exp $
* $Id: vout.h,v 1.7 2003/02/07 21:30:25 hartman Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -23,7 +23,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define WINDOW_TITLE_HEIGHT 21
#define WINDOW_TITLE_HEIGHT 24
/*****************************************************************************
* VLCWindow interface
......@@ -36,9 +36,7 @@
- (void)setVout:(vout_thread_t *)_p_vout;
- (vout_thread_t *)getVout;
- (void)halfWindow;
- (void)normalWindow;
- (void)doubleWindow;
- (void)scaleWindowWithFactor: (float)factor;
- (void)toggleFullscreen;
- (BOOL)isFullscreen;
......
......@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.24 2003/02/07 20:23:17 hartman Exp $
* $Id: vout.m,v 1.25 2003/02/07 21:30:25 hartman Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -725,37 +725,25 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
return( p_vout );
}
- (void)halfWindow
- (void)scaleWindowWithFactor: (float)factor
{
NSSize newsize;
NSPoint topleftbase;
NSPoint topleftscreen;
newsize.width = (int) p_vout->render.i_width / 2 ;
newsize.height = ((int) p_vout->render.i_height / 2 ) + WINDOW_TITLE_HEIGHT ;
[self setContentSize: newsize];
//[[self contentView] setFrameSize: newsize];
p_vout->i_changes |= VOUT_SIZE_CHANGE;
}
- (void)normalWindow
{
NSSize newsize;
newsize.width = p_vout->render.i_width ;
newsize.height = p_vout->render.i_height + WINDOW_TITLE_HEIGHT ;
[self setContentSize: newsize];
//[[self contentView] setFrameSize: newsize];
p_vout->i_changes |= VOUT_SIZE_CHANGE;
}
- (void)doubleWindow
{
NSSize newsize;
newsize.width = p_vout->render.i_width * 2 ;
newsize.height = (p_vout->render.i_height * 2 ) + WINDOW_TITLE_HEIGHT;
[self setContentSize: newsize];
//[[self contentView] setFrameSize: newsize];
p_vout->i_changes |= VOUT_SIZE_CHANGE;
if ( !p_vout->b_fullscreen )
{
topleftbase.x = 0;
topleftbase.y = [self frame].size.height;
topleftscreen = [self convertBaseToScreen: topleftbase];
newsize.width = (int) ( p_vout->render.i_width * factor );
newsize.height = (int) ( ( p_vout->render.i_height + WINDOW_TITLE_HEIGHT ) * factor );
[self setContentSize: newsize];
[self setFrameTopLeftPoint: topleftscreen];
p_vout->i_changes |= VOUT_SIZE_CHANGE;
}
}
- (void)toggleFullscreen
......
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