Commit 621eb734 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/playlist.cpp: better playlist window resizing.

parent ff5829d0
...@@ -320,6 +320,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -320,6 +320,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
listview->SetColumnWidth( 0, 250 ); listview->SetColumnWidth( 0, 250 );
listview->InsertColumn( 1, wxU(_("Duration")) ); listview->InsertColumn( 1, wxU(_("Duration")) );
listview->SetColumnWidth( 1, 75 ); listview->SetColumnWidth( 1, 75 );
listview->Layout();
/* Create the Up-Down buttons */ /* Create the Up-Down buttons */
wxButton *up_button = wxButton *up_button =
...@@ -338,7 +339,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -338,7 +339,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
panel_sizer->Add( listview, 1, wxEXPAND | wxALL, 5 ); panel_sizer->Add( listview, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( bottom_sizer, 0, wxEXPAND | wxALL, 5); panel_sizer->Add( bottom_sizer, 0, wxALL, 5);
panel_sizer->Layout(); panel_sizer->Layout();
playlist_panel->SetSizerAndFit( panel_sizer ); playlist_panel->SetSizerAndFit( panel_sizer );
...@@ -371,19 +372,15 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -371,19 +372,15 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
/* Update the playlist */ /* Update the playlist */
Rebuild(); Rebuild();
DoSize();
} }
void Playlist::OnSize( wxSizeEvent& event) void Playlist::OnSize( wxSizeEvent& event)
{
DoSize();
event.Skip();
}
void Playlist::DoSize()
{ {
wxSize size = GetClientSize(); wxSize size = GetClientSize();
if( listview ) listview->SetSize( 0,0, size.x ,size.y * 4 / 5); if( listview )
listview->SetColumnWidth( 0, size.x - listview->GetColumnWidth(1)
- 15 /* margins */ );
event.Skip();
} }
Playlist::~Playlist() Playlist::~Playlist()
......
...@@ -677,8 +677,7 @@ private: ...@@ -677,8 +677,7 @@ private:
/* Event handlers (these functions should _not_ be virtual) */ /* Event handlers (these functions should _not_ be virtual) */
void OnSize( wxSizeEvent &event); void OnSize( wxSizeEvent &event );
void DoSize();
void OnAddFile( wxCommandEvent& event ); void OnAddFile( wxCommandEvent& event );
void OnAddMRL( wxCommandEvent& event ); void OnAddMRL( wxCommandEvent& event );
......
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