Fix very wide spin button on Linux.
[dcpomatic.git] / src / wx / dcp_panel.cc
index 8109741fb39f6510bb78f3ff291c6fb2a90a9c48..aa3cf4b22d33677b308aa57b2e27f89739d8edb0 100644 (file)
 
 */
 
-#include "dcp_panel.h"
-#include "wx_util.h"
 #include "audio_dialog.h"
-#include "focus_manager.h"
 #include "check_box.h"
-#include "static_text.h"
 #include "check_box.h"
+#include "dcp_panel.h"
 #include "dcpomatic_button.h"
-#include "markers_dialog.h"
+#include "dcpomatic_spin_ctrl.h"
+#include "focus_manager.h"
 #include "interop_metadata_dialog.h"
+#include "markers_dialog.h"
 #include "smpte_metadata_dialog.h"
+#include "static_text.h"
+#include "wx_util.h"
 #include "lib/ratio.h"
 #include "lib/config.h"
 #include "lib/dcp_content_type.h"
@@ -718,16 +719,22 @@ DCPPanel::make_video_panel ()
        _resolution_label = create_label (panel, _("Resolution"), true);
        _resolution = new wxChoice (panel, wxID_ANY);
 
+#ifdef __WXGTK3__
+       int const spin_width = 118;
+#else
+       int const spin_width = 56;
+#endif
+
        _frame_rate_label = create_label (panel, _("Frame Rate"), true);
        _frame_rate_choice = new wxChoice (panel, wxID_ANY);
-       _frame_rate_spin = new wxSpinCtrl (panel, wxID_ANY);
+       _frame_rate_spin = new SpinCtrl (panel, spin_width);
        setup_frame_rate_widget ();
        _best_frame_rate = new Button (panel, _("Use best"));
 
        _three_d = new CheckBox (panel, _("3D"));
 
        _j2k_bandwidth_label = create_label (panel, _("JPEG2000 bandwidth\nfor newly-encoded data"), true);
-       _j2k_bandwidth = new wxSpinCtrl (panel, wxID_ANY);
+       _j2k_bandwidth = new SpinCtrl (panel, spin_width);
        _mbits_label = create_label (panel, _("Mbit/s"), false);
 
        _reencode_j2k = new CheckBox (panel, _("Re-encode JPEG2000 data from input"));
@@ -797,7 +804,7 @@ DCPPanel::add_video_panel_to_grid ()
        auto s = new wxBoxSizer (wxHORIZONTAL);
        s->Add (_j2k_bandwidth, 0, wxALIGN_CENTER_VERTICAL);
        add_label_to_sizer (s, _mbits_label, false, 0, wxLEFT | wxALIGN_CENTER_VERTICAL);
-       _video_grid->Add (s, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND);
+       _video_grid->Add (s, wxGBPosition(r, 1), wxDefaultSpan);
        ++r;
        _video_grid->Add (_reencode_j2k, wxGBPosition(r, 0), wxGBSpan(1, 2));
 }
@@ -834,7 +841,7 @@ DCPPanel::make_audio_panel ()
        _audio_processor = new wxChoice (panel, wxID_ANY);
        add_audio_processors ();
 
-       _show_audio = new Button (panel, _("Show audio..."));
+       _show_audio = new Button (panel, _("Show graph of audio levels..."));
 
        _audio_channels->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_channels_changed, this));
        _audio_processor->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_processor_changed, this));
@@ -889,7 +896,7 @@ DCPPanel::show_audio_clicked ()
 
        if (_audio_dialog) {
                _audio_dialog->Destroy ();
-               _audio_dialog = 0;
+               _audio_dialog = nullptr;
        }
 
        auto d = new AudioDialog (_panel, _film, _viewer);