diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-11-13 14:12:15 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-11-13 14:12:15 +0000 |
| commit | 71d56fbe3ba5974505469d2c8b7efcdef4eb8adc (patch) | |
| tree | 7967193b6b8668bf0de9439a635e1bc9f80283a8 /src/wx | |
| parent | df89a39cfd34d0d70609daa214d3b618bb6223bd (diff) | |
Disable YUV->RGB conversion controls with non-YUV sources (#649).
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/colour_conversion_editor.cc | 15 | ||||
| -rw-r--r-- | src/wx/colour_conversion_editor.h | 4 | ||||
| -rw-r--r-- | src/wx/content_colour_conversion_dialog.cc | 4 | ||||
| -rw-r--r-- | src/wx/content_colour_conversion_dialog.h | 2 | ||||
| -rw-r--r-- | src/wx/preset_colour_conversion_dialog.cc | 2 | ||||
| -rw-r--r-- | src/wx/video_panel.cc | 2 |
6 files changed, 18 insertions, 11 deletions
diff --git a/src/wx/colour_conversion_editor.cc b/src/wx/colour_conversion_editor.cc index 92dd417a5..c24cc689e 100644 --- a/src/wx/colour_conversion_editor.cc +++ b/src/wx/colour_conversion_editor.cc @@ -35,7 +35,7 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::lexical_cast; -ColourConversionEditor::ColourConversionEditor (wxWindow* parent) +ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv) : wxPanel (parent, wxID_ANY) { wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); @@ -92,15 +92,21 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent) /* YUV to RGB conversion */ - subhead (table, this, _("YUV to RGB conversion"), r); + wxStaticText* yuv_heading = subhead (table, this, _("YUV to RGB conversion"), r); - add_label_to_sizer (table, this, _("YUV to RGB matrix"), true, wxGBPosition (r, 0)); + wxStaticText* yuv_label = add_label_to_sizer (table, this, _("YUV to RGB matrix"), true, wxGBPosition (r, 0)); _yuv_to_rgb = new wxChoice (this, wxID_ANY); _yuv_to_rgb->Append (_("Rec. 601")); _yuv_to_rgb->Append (_("Rec. 709")); table->Add (_yuv_to_rgb, wxGBPosition (r, 1)); ++r; + if (!yuv) { + yuv_heading->Enable (false); + yuv_label->Enable (false); + _yuv_to_rgb->Enable (false); + } + /* RGB to XYZ conversion */ subhead (table, this, _("RGB to XYZ conversion"), r); @@ -207,13 +213,14 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent) _yuv_to_rgb->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&ColourConversionEditor::changed, this)); } -void +wxStaticText * ColourConversionEditor::subhead (wxGridBagSizer* sizer, wxWindow* parent, wxString text, int& row) const { wxStaticText* m = new wxStaticText (parent, wxID_ANY, wxT ("")); m->SetLabelMarkup ("<b>" + text + "</b>"); sizer->Add (m, wxGBPosition (row, 0), wxGBSpan (1, 3), wxALIGN_CENTER_VERTICAL | wxTOP, 12); ++row; + return m; } void diff --git a/src/wx/colour_conversion_editor.h b/src/wx/colour_conversion_editor.h index a987cb3a9..918f2a7d0 100644 --- a/src/wx/colour_conversion_editor.h +++ b/src/wx/colour_conversion_editor.h @@ -29,7 +29,7 @@ class ColourConversion; class ColourConversionEditor : public wxPanel { public: - ColourConversionEditor (wxWindow *); + ColourConversionEditor (wxWindow *, bool yuv); void set (ColourConversion); ColourConversion get () const; @@ -43,7 +43,7 @@ private: void adjusted_white_changed (); void update_rgb_to_xyz (); void update_bradford (); - void subhead (wxGridBagSizer* sizer, wxWindow* parent, wxString text, int& row) const; + wxStaticText* subhead (wxGridBagSizer* sizer, wxWindow* parent, wxString text, int& row) const; void set_text_ctrl (wxTextCtrl *, double); void set_spin_ctrl (wxSpinCtrlDouble *, double); diff --git a/src/wx/content_colour_conversion_dialog.cc b/src/wx/content_colour_conversion_dialog.cc index e4e16157d..651e1dc66 100644 --- a/src/wx/content_colour_conversion_dialog.cc +++ b/src/wx/content_colour_conversion_dialog.cc @@ -32,9 +32,9 @@ using std::vector; using std::cout; using boost::optional; -ContentColourConversionDialog::ContentColourConversionDialog (wxWindow* parent) +ContentColourConversionDialog::ContentColourConversionDialog (wxWindow* parent, bool yuv) : wxDialog (parent, wxID_ANY, _("Colour conversion")) - , _editor (new ColourConversionEditor (this)) + , _editor (new ColourConversionEditor (this, yuv)) , _setting (false) { wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); diff --git a/src/wx/content_colour_conversion_dialog.h b/src/wx/content_colour_conversion_dialog.h index f5687a060..4207ee082 100644 --- a/src/wx/content_colour_conversion_dialog.h +++ b/src/wx/content_colour_conversion_dialog.h @@ -25,7 +25,7 @@ class ColourConversionEditor; class ContentColourConversionDialog : public wxDialog { public: - ContentColourConversionDialog (wxWindow *); + ContentColourConversionDialog (wxWindow *, bool yuv); void set (ColourConversion); ColourConversion get () const; diff --git a/src/wx/preset_colour_conversion_dialog.cc b/src/wx/preset_colour_conversion_dialog.cc index 9656ff5dc..d77cc8ad4 100644 --- a/src/wx/preset_colour_conversion_dialog.cc +++ b/src/wx/preset_colour_conversion_dialog.cc @@ -29,7 +29,7 @@ using std::cout; PresetColourConversionDialog::PresetColourConversionDialog (wxWindow* parent) : wxDialog (parent, wxID_ANY, _("Colour conversion")) - , _editor (new ColourConversionEditor (this)) + , _editor (new ColourConversionEditor (this, true)) { wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); SetSizer (overall_sizer); diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 227f6c647..a2c35ec76 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -402,7 +402,7 @@ VideoPanel::edit_colour_conversion_clicked () return; } - ContentColourConversionDialog* d = new ContentColourConversionDialog (this); + ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->yuv ()); d->set (vc.front()->colour_conversion().get_value_or (PresetColourConversion::all().front ().conversion)); d->ShowModal (); vc.front()->set_colour_conversion (d->get ()); |
