Improve layout of export subtitles dialog, especially with de_DE translation.
authorCarl Hetherington <cth@carlh.net>
Wed, 12 Mar 2025 18:50:44 +0000 (19:50 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 12 Mar 2025 18:50:44 +0000 (19:50 +0100)
src/wx/export_subtitles_dialog.cc
src/wx/export_subtitles_dialog.h

index 312d8288242fd11b8323e1401dda8868655671d6..128cd8948373447e2612d4e28944e08ac682486d 100644 (file)
@@ -35,21 +35,23 @@ using boost::bind;
 
 
 ExportSubtitlesDialog::ExportSubtitlesDialog (wxWindow* parent, int reels, bool interop)
-       : TableDialog (parent, _("Export subtitles"), 2, 1, true)
+       : wxDialog(parent, wxID_ANY, _("Export subtitles"))
        , _interop (interop)
-       , _include_font (0)
 {
+       auto sizer = new wxGridBagSizer(DCPOMATIC_SIZER_GAP, DCPOMATIC_SIZER_GAP);
+
+       int r = 0;
        _split_reels = new CheckBox (this, _("Write reels into separate files"));
-       add (_split_reels, false);
-       add_spacer ();
+       sizer->Add(_split_reels, wxGBPosition(r, 0), wxGBSpan(1, 2));
+       ++r;
 
        if (reels > 1) {
                _split_reels->Enable (false);
        }
 
        _include_font = new CheckBox (this, _("Define font in output and export font file"));
-       add (_include_font, false);
-       add_spacer ();
+       sizer->Add(_include_font, wxGBPosition(r, 0), wxGBSpan(1, 2));
+       ++r;
 
        if (!_interop) {
                _include_font->Enable (false);
@@ -57,20 +59,31 @@ ExportSubtitlesDialog::ExportSubtitlesDialog (wxWindow* parent, int reels, bool
 
        wxString const wildcard = _interop ? _("Subtitle files (.xml)|*.xml") : _("Subtitle files (.mxf)|*.mxf");
 
-       _file_label = add (_("Output file"), true);
+       _file_label = new wxStaticText(this, wxID_ANY, _("Output file"));
+       sizer->Add(_file_label, wxGBPosition(r, 0));
        _file = new FilePickerCtrl(this, _("Select output file"), wildcard, false, true, "ExportSubtitlesPath");
-       add (_file);
+       sizer->Add(_file, wxGBPosition(r, 1));
+       ++r;
 
-       _dir_label = add (_("Output folder"), true);
+       _dir_label = new wxStaticText(this, wxID_ANY, (_("Output folder")));
+       sizer->Add(_dir_label, wxGBPosition(r, 0));
        _dir = new DirPickerCtrl (this);
-       add (_dir);
+       sizer->Add(_dir, wxGBPosition(r, 1));
 
        _split_reels->bind(&ExportSubtitlesDialog::setup_sensitivity, this);
        _include_font->bind(&ExportSubtitlesDialog::setup_sensitivity, this);
        _file->Bind (wxEVT_FILEPICKER_CHANGED, bind(&ExportSubtitlesDialog::setup_sensitivity, this));
        _dir->Bind (wxEVT_DIRPICKER_CHANGED, bind(&ExportSubtitlesDialog::setup_sensitivity, this));
 
-       layout ();
+       auto overall_sizer = new wxBoxSizer(wxVERTICAL);
+       overall_sizer->Add(sizer, 1, wxALL, DCPOMATIC_DIALOG_BORDER);
+
+       auto buttons = CreateSeparatedButtonSizer(wxOK | wxCANCEL);
+       if (buttons) {
+               overall_sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
+       }
+
+       SetSizerAndFit(overall_sizer);
        setup_sensitivity ();
 }
 
index 0a3177cac8b53b7562ce30ba596697dcc677bffc..52170418e411188671373c22f03a9119fe914ef4 100644 (file)
@@ -20,7 +20,6 @@
 
 
 #include "dir_picker_ctrl.h"
-#include "table_dialog.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
@@ -32,7 +31,7 @@ class CheckBox;
 class FilePickerCtrl;
 
 
-class ExportSubtitlesDialog : public TableDialog
+class ExportSubtitlesDialog : public wxDialog
 {
 public:
        ExportSubtitlesDialog (wxWindow* parent, int reels, bool interop);
@@ -46,7 +45,7 @@ private:
 
        bool _interop;
        CheckBox* _split_reels;
-       CheckBox* _include_font;
+       CheckBox* _include_font = nullptr;
        wxStaticText* _file_label;
        FilePickerCtrl* _file;
        DirPickerCtrl* _dir;