mirror of https://code.videolan.org/videolan/vlc
implement some minimum size of wx interface at all times. closes ticket #360.
This commit is contained in:
parent
9342d5eeea
commit
826fad102b
|
@ -1,4 +1,4 @@
|
|||
dnl $Id: configure.ac,v 1.2 2004/02/13 11:33:38 rocky Exp $
|
||||
dnl $Id$
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(manual.xml.in,0.0.1)
|
||||
|
|
|
@ -447,4 +447,4 @@ analyze the contents of a CD.
|
|||
The tool cd-read from libcdio can be used to show the sectors of
|
||||
the CD or CD image or extract sectors.
|
||||
|
||||
$Id: intf-cdda.txt,v 1.6 2004/02/11 12:37:28 rocky Exp $
|
||||
$Id$
|
||||
|
|
|
@ -544,4 +544,4 @@ http://www.vcdhelp.com/
|
|||
http://www.vcdimager.org/
|
||||
http://www.vcdimager.org/guides/#guides
|
||||
|
||||
$Id: intf-vcd.txt,v 1.5 2004/02/11 12:37:28 rocky Exp $
|
||||
$Id$
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$Id: cvd-subtitles.txt,v 1.4 2004/02/13 00:57:03 rocky Exp $
|
||||
$Id$
|
||||
The following information is culled from information from
|
||||
Julio Sanchez Fernandez (http://subhandler.sourceforge.net)
|
||||
by Rocky Bernstein.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$Id: svcd-ogt-subtitles.txt,v 1.2 2004/02/13 00:57:03 rocky Exp $
|
||||
$Id$
|
||||
The following information is culled from information from
|
||||
Julio Sanchez Fernandez (http://subhandler.sourceforge.net)
|
||||
by Rocky Bernstein.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* cmd_minimize.cpp
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2003 the VideoLAN team
|
||||
* $Id: cmd_fullscreen.cpp 6961 2004-03-05 17:34:23Z sam $
|
||||
* $Id$
|
||||
*
|
||||
* Authors: Mohammed Adnène Trojette <adn@via.ecp.fr>
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* cmd_minimize.hpp
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2003 the VideoLAN team
|
||||
* $Id: cmd_fullscreen.hpp 6961 2004-03-05 17:34:23Z sam $
|
||||
* $Id$
|
||||
*
|
||||
* Authors: Mohammed Adnène Trojette <adn@via.ecp.fr>
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* cmd_playtree.cpp
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2005 VideoLAN
|
||||
* $Id: cmd_playlist.cpp 10101 2005-03-02 16:47:31Z robux4 $
|
||||
* $Id$
|
||||
*
|
||||
* Authors: Antoine Cellerier <dionoea@videolan.org>
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* cmd_playtree.hpp
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2005 VideoLAN
|
||||
* $Id: cmd_playlist.hpp 9934 2005-02-15 13:55:08Z courmisch $
|
||||
* $Id$
|
||||
*
|
||||
* Authors: Antoine Cellerier <dionoea@videolan.org>
|
||||
*
|
||||
|
|
|
@ -336,13 +336,32 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
|
|||
Move( p );
|
||||
|
||||
/* Set minimum window size to prevent user from glitching it */
|
||||
wxSize s2;
|
||||
s = GetSize();
|
||||
|
||||
/* save smallest possible default minimum size */
|
||||
default_size = GetSize();
|
||||
|
||||
/* save slider size for height only for MinSizing */
|
||||
slider_size = slider_sizer->GetSize();
|
||||
|
||||
/* and save extended gui size for MinSize scheme */
|
||||
s2 = extra_frame->GetSize();
|
||||
s2.SetWidth( s2.GetWidth() +
|
||||
2 * wxSystemSettings::GetMetric( wxSYS_FRAMESIZE_X ) );
|
||||
extended_size = s2;
|
||||
|
||||
/* Set initial minimum window size */
|
||||
if( config_GetInt( p_intf, "wx-embed" ) )
|
||||
{
|
||||
wxSize s2;
|
||||
s2 = video_window->GetSize();
|
||||
s.SetHeight( s.GetHeight() - s2.GetHeight() );
|
||||
}
|
||||
if( config_GetInt( p_intf, "wx-extended" ) )
|
||||
{
|
||||
s.SetWidth( extended_size.GetWidth() );
|
||||
s.SetHeight( s.GetHeight() + extended_size.GetHeight() );
|
||||
}
|
||||
#if (wxCHECK_VERSION(2,5,4))
|
||||
SetMinSize( s );
|
||||
#else
|
||||
|
@ -506,22 +525,14 @@ void Interface::CreateOurMenuBar()
|
|||
HDC hdc = GetDC( NULL );
|
||||
for( unsigned int i = 0; i < menubar->GetMenuCount(); i++ )
|
||||
{
|
||||
// [ MENU BUTTON WIDTH CALCULATION ]
|
||||
// [ SM_CXDLGFRAME + pixels + textextent + pixels + SM_CXDLGFRAME ]
|
||||
GetTextExtentPoint32( hdc, menubar->GetLabelTop(i).c_str(),
|
||||
menubar->GetLabelTop(i).Length(), &sizing );
|
||||
// + text size..
|
||||
i_size += sizing.cx;
|
||||
// +1 more pixel on each size
|
||||
i_size += 2;
|
||||
// width of 2 DLGFRAME
|
||||
i_size += GetSystemMetrics( SM_CXDLGFRAME ) * 2;
|
||||
|
||||
// [ SM_CXDLGFRAME + pixels + textextent + pixels + SM_CXDLGFRAME ]
|
||||
i_size += sizing.cx + 2 + GetSystemMetrics( SM_CXDLGFRAME ) * 2;
|
||||
}
|
||||
ReleaseDC( NULL, hdc );
|
||||
// Width of 2 edges of app window
|
||||
i_size += GetSystemMetrics( SM_CXSIZEFRAME ) * 2;
|
||||
// + 2 more pixels on each side..
|
||||
i_size += 4;
|
||||
i_size += GetSystemMetrics( SM_CXSIZEFRAME ) * 2 + 4;
|
||||
#endif
|
||||
/* End patch by zcot */
|
||||
|
||||
|
@ -762,11 +773,27 @@ void Interface::ShowSlider( bool show, bool layout )
|
|||
|
||||
//prevent continuous layout
|
||||
if( slider_frame->IsShown() ) return;
|
||||
|
||||
wxSize ms = GetMinSize();
|
||||
ms.SetHeight( ms.GetHeight() + slider_size.GetHeight() );
|
||||
#if ( wxCHECK_VERSION( 2,5,4 ) )
|
||||
SetMinSize( ms );
|
||||
#else
|
||||
frame_sizer->SetMinSize( ms );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
//prevent continuous layout
|
||||
if( !slider_frame->IsShown() ) return;
|
||||
|
||||
wxSize ms = GetMinSize();
|
||||
ms.SetHeight( ms.GetHeight() - slider_size.GetHeight() );
|
||||
#if ( wxCHECK_VERSION( 2,5,4 ) )
|
||||
SetMinSize( ms );
|
||||
#else
|
||||
frame_sizer->SetMinSize( ms );
|
||||
#endif
|
||||
}
|
||||
|
||||
if( layout && p_intf->p_sys->b_video_autosize )
|
||||
|
@ -1009,11 +1036,27 @@ void Interface::OnExtended(wxCommandEvent& event)
|
|||
{
|
||||
extra_frame->Hide();
|
||||
frame_sizer->Hide( extra_frame );
|
||||
wxSize ms = GetMinSize();
|
||||
ms.SetHeight( ms.GetHeight() - extended_size.GetHeight() );
|
||||
ms.SetWidth( default_size.GetWidth() );
|
||||
#if ( wxCHECK_VERSION( 2,5,4 ) )
|
||||
SetMinSize( ms );
|
||||
#else
|
||||
frame_sizer->SetMinSize( ms );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
extra_frame->Show();
|
||||
frame_sizer->Show( extra_frame );
|
||||
wxSize ms = GetMinSize();
|
||||
ms.SetHeight( ms.GetHeight() + extended_size.GetHeight() );
|
||||
ms.SetWidth( extended_size.GetWidth() );
|
||||
#if ( wxCHECK_VERSION( 2,5,4 ) )
|
||||
SetMinSize( ms );
|
||||
#else
|
||||
frame_sizer->SetMinSize( ms );
|
||||
#endif
|
||||
}
|
||||
frame_sizer->Layout();
|
||||
frame_sizer->Fit(this);
|
||||
|
|
|
@ -187,6 +187,11 @@ namespace wxvlc
|
|||
wxMenu *p_audio_menu;
|
||||
wxMenu *p_video_menu;
|
||||
wxMenu *p_navig_menu;
|
||||
|
||||
/* utility dimensions */
|
||||
wxSize default_size;
|
||||
wxSize extended_size;
|
||||
wxSize slider_size;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue