Commit b478e5fc authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/interface.cpp: fit the default size of the interface to the menubar.

parent bf150e00
...@@ -370,6 +370,17 @@ void Interface::CreateOurMenuBar() ...@@ -370,6 +370,17 @@ void Interface::CreateOurMenuBar()
/* Attach the menu bar to the frame */ /* Attach the menu bar to the frame */
SetMenuBar( menubar ); SetMenuBar( menubar );
/* Find out size of menu bar */
int i_size = 0;
for( int i = 0; i < menubar->GetMenuCount(); i++ )
{
int i_width, i_height;
menubar->GetTextExtent( menubar->GetLabelTop(i), &i_width, &i_height );
i_size += i_width + 4 /* approximate margin */;
}
frame_sizer->SetMinSize( i_size, -1 );
/* Intercept all menu events in our custom event handler */ /* Intercept all menu events in our custom event handler */
PushEventHandler( new MenuEvtHandler( p_intf, this ) ); PushEventHandler( new MenuEvtHandler( p_intf, this ) );
...@@ -461,9 +472,6 @@ void Interface::CreateOurToolBar() ...@@ -461,9 +472,6 @@ void Interface::CreateOurToolBar()
toolbar->Realize(); toolbar->Realize();
// '7' is the number of buttons on the toolbar, '3' is arbitrary :)
frame_sizer->SetMinSize( TOOLBAR_BMP_WIDTH * 7 * 3, -1 );
#if !defined(__WXX11__) #if !defined(__WXX11__)
/* Associate drop targets with the toolbar */ /* Associate drop targets with the toolbar */
toolbar->SetDropTarget( new DragAndDrop( p_intf ) ); toolbar->SetDropTarget( new DragAndDrop( p_intf ) );
......
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