diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-01-12 20:36:46 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-01-13 00:06:28 +0000 |
| commit | 9b1c6dd87c2a1b0b480a23da756d22c3bfedd9f1 (patch) | |
| tree | 37eaa7473aee114872ffb447da23dce28249ad65 /src/wx | |
| parent | 67a404fff364c6e1fa02eab270755895ba0e1fe8 (diff) | |
Note whether effect is forced or not.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/subtitle_appearance_dialog.cc | 37 | ||||
| -rw-r--r-- | src/wx/subtitle_appearance_dialog.h | 1 |
2 files changed, 27 insertions, 11 deletions
diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc index 929bc6006..34bdeca46 100644 --- a/src/wx/subtitle_appearance_dialog.cc +++ b/src/wx/subtitle_appearance_dialog.cc @@ -69,8 +69,14 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr ++r; add_label_to_sizer (_table, this, _("Effect"), true, wxGBPosition (r, 0)); - _effect = new wxChoice (this, wxID_ANY); - _table->Add (_effect, wxGBPosition (r, 1)); + { + wxSizer* s = new wxBoxSizer (wxHORIZONTAL); + _force_effect = new wxCheckBox (this, wxID_ANY, _("Set to")); + s->Add (_force_effect, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 8); + _effect = new wxChoice (this, wxID_ANY); + s->Add (_effect, 0, wxALIGN_CENTER_VERTICAL); + _table->Add (s, wxGBPosition (r, 1)); + } ++r; add_label_to_sizer (_table, this, _("Effect colour"), true, wxGBPosition (r, 0)); @@ -157,16 +163,23 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr _colour->SetColour (wxColour (255, 255, 255)); } - switch (_content->subtitle->effect()) { - case dcp::NONE: + optional<dcp::Effect> effect = _content->subtitle->effect(); + if (effect) { + _force_effect->SetValue (true); + switch (*effect) { + case dcp::NONE: + _effect->SetSelection (NONE); + break; + case dcp::BORDER: + _effect->SetSelection (OUTLINE); + break; + case dcp::SHADOW: + _effect->SetSelection (SHADOW); + break; + } + } else { + _force_effect->SetValue (false); _effect->SetSelection (NONE); - break; - case dcp::BORDER: - _effect->SetSelection (OUTLINE); - break; - case dcp::SHADOW: - _effect->SetSelection (SHADOW); - break; } optional<dcp::Colour> effect_colour = _content->subtitle->effect_colour(); @@ -184,6 +197,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr _force_colour->Bind (wxEVT_CHECKBOX, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); _force_effect_colour->Bind (wxEVT_CHECKBOX, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); + _force_effect->Bind (wxEVT_CHECKBOX, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); _effect->Bind (wxEVT_CHOICE, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); _content_connection = _content->Changed.connect (bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); @@ -245,6 +259,7 @@ SubtitleAppearanceDialog::setup_sensitivity () { _colour->Enable (_force_colour->GetValue ()); _effect_colour->Enable (_force_effect_colour->GetValue ()); + _effect->Enable (_force_effect->GetValue ()); bool const can_outline_width = _effect->GetSelection() == OUTLINE && _content->subtitle->burn (); _outline_width->Enable (can_outline_width); diff --git a/src/wx/subtitle_appearance_dialog.h b/src/wx/subtitle_appearance_dialog.h index 99eba133a..7a23b8199 100644 --- a/src/wx/subtitle_appearance_dialog.h +++ b/src/wx/subtitle_appearance_dialog.h @@ -44,6 +44,7 @@ private: wxCheckBox* _force_colour; wxColourPickerCtrl* _colour; + wxCheckBox* _force_effect; wxChoice* _effect; wxCheckBox* _force_effect_colour; wxColourPickerCtrl* _effect_colour; |
