Commit bb06a7fe authored by Clément Stenac's avatar Clément Stenac

Misc WX improvements - patches by zcot

* Option to have extended interface by default (Closes: #232)
* Fix "floating" volume bar with wxMSW 2.6.X (Closes:#289)
* Enforce minimum vertical size (Closes:#360)
* Fix a font size problem on WX

* Add him to THANKS, obviously :)
parent 8b290cc6
......@@ -95,6 +95,7 @@ Remco Poortinga <poortinga at telin.nl> - IPv6 multicast patch
Rene Gollent <rgollent at u.arizona.edu> - BeOS interface fix
Roine Gustafsson <roine at popstar.com> - spudec bug fixes
Rudolf Cornelissen <rag.cornelissen at inter.nl.net> - BeOS fixes
Scott Claude <cutmancw at hotmail dot com> - Visualisation, WX improvements
Sebastien Chaumat <Sebastien.Chaumat at ens-lyon.fr> - YOPY port tests
Steve Lhomme <steve dot lhomme at free dot fr> - MSVC fixes and Matroska enhancements
Steve Brown <sbrown at cortland.com> - fix for optional PES size bug
......
......@@ -330,6 +330,20 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
if( ws->GetSettings( WindowSettings::ID_MAIN, b_shown, p, s ) )
Move( p );
/* Set minimum window size to prevent user from glitching it */
s = GetSize();
if( config_GetInt( p_intf, "wx-embed" ) )
{
wxSize s2;
s2 = video_window->GetSize();
s.SetHeight( s.GetHeight() - s2.GetHeight() );
}
SetMinSize( s );
/* Show extended GUI if requested */
if( ( b_extra = config_GetInt( p_intf, "wx-extended" ) ) )
frame_sizer->Show( extra_frame );
}
Interface::~Interface()
......@@ -359,7 +373,7 @@ Interface::~Interface()
void Interface::Init()
{
/* Misc init */
SetupHotkeys();
//SetupHotkeys();
}
void Interface::Update()
......@@ -473,6 +487,34 @@ void Interface::CreateOurMenuBar()
#endif
#endif
}
/* Patch by zcot for menu wrapping */
#if defined(WIN32)
/* Find out size of msw menu bar */
i_size = 0;
SIZE sizing;
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),
strlen( menubar->GetLabelTop(i) ),
&sizing );
i_size += sizing.cx; // + text size..
// +1 more pixel on each size
i_size += 2;
// width of 2 DLGFRAME
i_size += 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;
#endif
/* End patch by zcot */
frame_sizer->SetMinSize( i_size, -1 );
/* Intercept all menu events in our custom event handler */
......@@ -536,11 +578,13 @@ void Interface::CreateOurToolBar()
wxU(_(HELP_PLO)) );
}
#if !( (wxMAJOR_VERSION <= 2) && (wxMINOR_VERSION <= 6) && (wxRELEASE_NUMBER < 2) )
wxControl *p_dummy_ctrl =
new wxControl( toolbar, -1, wxDefaultPosition,
wxSize(35, 16 ), wxBORDER_NONE );
toolbar->AddControl( p_dummy_ctrl );
#endif
volctrl = new VLCVolCtrl( p_intf, toolbar );
toolbar->AddControl( volctrl );
......
......@@ -89,6 +89,8 @@ private:
#define BOOKMARKS_TEXT N_("Show bookmarks dialog")
#define BOOKMARKS_LONGTEXT N_("Show bookmarks dialog when the interface " \
"starts.")
#define EXTENDED_TEXT N_("Show extended GUI")
#define EXTENDED_LONGTEXT N_("Show extended GUI")
#define TASKBAR_TEXT N_("Show taskbar entry")
#define TASKBAR_LONGTEXT N_("Show taskbar entry")
#define MINIMAL_TEXT N_("Minimal interface")
......@@ -125,6 +127,8 @@ vlc_module_begin();
add_bool( "wx-taskbar", 1, NULL,
TASKBAR_TEXT, TASKBAR_LONGTEXT, VLC_FALSE );
add_deprecated( "wxwin-taskbar", VLC_FALSE); /*Deprecated since 0.8.4*/
add_bool( "wx-extended", 0, NULL,
EXTENDED_TEXT, EXTENDED_LONGTEXT, VLC_FALSE );
add_bool( "wx-minimal", 0, NULL,
MINIMAL_TEXT, MINIMAL_LONGTEXT, VLC_TRUE );
add_deprecated( "wxwin-minimal", VLC_FALSE); /*Deprecated since 0.8.4*/
......
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