From: Carl Hetherington Date: Fri, 12 Jun 2015 22:55:51 +0000 (+0100) Subject: Add a close button to the AudioDialog on Linux in case it doesn't get a close button... X-Git-Tag: v2.1.0~7 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=5b7a58b4a4ef83866f21ebb755a1ddcfdb8c1c2a Add a close button to the AudioDialog on Linux in case it doesn't get a close button (#602). --- diff --git a/ChangeLog b/ChangeLog index b75cf7cb4..f029fb104 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2015-06-12 Carl Hetherington + * Add a close button to the audio plot on Linux (#602). + * Version 2.0.51 released. 2015-06-12 Carl Hetherington diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index 0034e793d..7a13a24a0 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -39,7 +39,8 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film) wxFont subheading_font (*wxNORMAL_FONT); subheading_font.SetWeight (wxFONTWEIGHT_BOLD); - wxBoxSizer* sizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); + wxBoxSizer* lr_sizer = new wxBoxSizer (wxHORIZONTAL); wxBoxSizer* left = new wxBoxSizer (wxVERTICAL); @@ -48,7 +49,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film) _peak_time = new wxStaticText (this, wxID_ANY, wxT ("")); left->Add (_peak_time, 0, wxALL, 12); - sizer->Add (left, 1, wxALL, 12); + lr_sizer->Add (left, 1, wxALL, 12); wxBoxSizer* right = new wxBoxSizer (wxVERTICAL); @@ -91,11 +92,20 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film) _smoothing->Bind (wxEVT_SCROLL_THUMBTRACK, boost::bind (&AudioDialog::smoothing_changed, this)); right->Add (_smoothing, 0, wxEXPAND); - sizer->Add (right, 0, wxALL, 12); + lr_sizer->Add (right, 0, wxALL, 12); - SetSizer (sizer); - sizer->Layout (); - sizer->SetSizeHints (this); + overall_sizer->Add (lr_sizer); + +#ifdef DCPOMATIC_LINUX + wxSizer* buttons = CreateSeparatedButtonSizer (wxCLOSE); + if (buttons) { + overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); + } +#endif + + SetSizer (overall_sizer); + overall_sizer->Layout (); + overall_sizer->SetSizeHints (this); } void