Add DCPOMATIC_SPIN_CTRL_WIDTH and use it in a few places.
authorCarl Hetherington <cth@carlh.net>
Fri, 7 May 2021 20:14:33 +0000 (22:14 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 7 May 2021 20:14:33 +0000 (22:14 +0200)
src/wx/custom_scale_dialog.cc
src/wx/dcp_panel.cc
src/wx/text_panel.cc
src/wx/wx_util.h

index 8a5f9e12861475f607639a4ff539ac72347722ce..48f476a9f7bbd1c368ba6f14f67978305c1a1545 100644 (file)
@@ -49,19 +49,13 @@ CustomScaleDialog::CustomScaleDialog (wxWindow* parent, dcp::Size initial, dcp::
        _size_from_ratio = new wxStaticText (this, wxID_ANY, wxT(""));
        add (_size_from_ratio, 1, wxALIGN_CENTER_VERTICAL);
 
-#ifdef __WXGTK3__
-       int const spin_width = 118;
-#else
-       int const spin_width = 64;
-#endif
-
        _size = new wxRadioButton (this, wxID_ANY, _("Set size"));
        add (_size);
        s = new wxBoxSizer (wxHORIZONTAL);
-       _width = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(spin_width, -1), wxSP_ARROW_KEYS, 1, film_container.width);
+       _width = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(DCPOMATIC_SPIN_CTRL_WIDTH, -1), wxSP_ARROW_KEYS, 1, film_container.width);
        s->Add (_width, 1, wxRIGHT, 4);
        add_label_to_sizer (s, this, wxT("x"), false, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL);
-       _height = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(spin_width, -1), wxSP_ARROW_KEYS, 1, film_container.height);
+       _height = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(DCPOMATIC_SPIN_CTRL_WIDTH, -1), wxSP_ARROW_KEYS, 1, film_container.height);
        s->Add (_height, 1, wxRIGHT, 4);
        add (s);
        _ratio_from_size = new wxStaticText (this, wxID_ANY, wxT(""));
index 4421b81b253f47afc53ad2cb044337521785d1bd..03d08beed5def83236b5a82b066794b0d4efdb96 100644 (file)
@@ -107,7 +107,7 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> v
        _reel_type = new wxChoice (_panel, wxID_ANY);
 
        _reel_length_label = create_label (_panel, _("Reel length"), true);
-       _reel_length = new wxSpinCtrl (_panel, wxID_ANY);
+       _reel_length = new SpinCtrl (_panel, DCPOMATIC_SPIN_CTRL_WIDTH);
        _reel_length_gb_label = create_label (_panel, _("GB"), false);
 
        _standard_label = create_label (_panel, _("Standard"), true);
@@ -746,22 +746,16 @@ 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 SpinCtrl (panel, spin_width);
+       _frame_rate_spin = new SpinCtrl (panel, DCPOMATIC_SPIN_CTRL_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 SpinCtrl (panel, spin_width);
+       _j2k_bandwidth = new SpinCtrl (panel, DCPOMATIC_SPIN_CTRL_WIDTH);
        _mbits_label = create_label (panel, _("Mbit/s"), false);
 
        _reencode_j2k = new CheckBox (panel, _("Re-encode JPEG2000 data from input"));
index 8e6d5cd68cc198854588d670c3762b6f58a8b9a7..ebeb518ddb2e1f2d15e2e9483aad74fcab2aae39 100644 (file)
@@ -82,30 +82,24 @@ TextPanel::TextPanel (ContentPanel* p, TextType t)
 
        _burn = new CheckBox (this, _("Burn subtitles into image"));
 
-#ifdef __WXGTK3__
-       int const spin_width = 118;
-#else
-       int const spin_width = 56;
-#endif
-
        _offset_label = create_label (this, _("Offset"), true);
        _x_offset_label = create_label (this, _("X"), true);
-       _x_offset = new SpinCtrl (this, spin_width);
+       _x_offset = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH);
        _x_offset_pc_label = new StaticText (this, _("%"));
        _y_offset_label = create_label (this, _("Y"), true);
-       _y_offset = new SpinCtrl (this, spin_width);
+       _y_offset = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH);
        _y_offset_pc_label = new StaticText (this, _("%"));
 
        _scale_label = create_label (this, _("Scale"), true);
        _x_scale_label = create_label (this, _("X"), true);
-       _x_scale = new SpinCtrl (this, spin_width);
+       _x_scale = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH);
        _x_scale_pc_label = new StaticText (this, _("%"));
        _y_scale_label = create_label (this, S_("Coord|Y"), true);
-       _y_scale = new SpinCtrl (this, spin_width);
+       _y_scale = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH);
        _y_scale_pc_label = new StaticText (this, _("%"));
 
        _line_spacing_label = create_label (this, _("Line spacing"), true);
-       _line_spacing = new SpinCtrl (this, spin_width);
+       _line_spacing = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH);
        _line_spacing_pc_label = new StaticText (this, _("%"));
 
        _stream_label = create_label (this, _("Stream"), true);
index 1c459595e20ebcdc7a91247868a873cac480e54b..0c2eabce0faf4db9ea347d7951c8089df5984b2a 100644 (file)
@@ -51,6 +51,11 @@ class PasswordEntry;
 #define DCPOMATIC_SIZER_Y_GAP 8
 #define DCPOMATIC_SIZER_GAP 8
 #define DCPOMATIC_DIALOG_BORDER 12
+#ifdef __WXGTK3__
+#define DCPOMATIC_SPIN_CTRL_WIDTH 118
+#else
+#define DCPOMATIC_SPIN_CTRL_WIDTH 56
+#endif
 
 /** Spacing to use between buttons in a vertical/horizontal line */
 #if defined(DCPOMATIC_OSX) || defined(__WXGTK3__)