diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-08-12 22:03:11 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-08-12 23:18:53 +0200 |
| commit | 19e47294d1de485a12dccf2c25bec0c8144049e8 (patch) | |
| tree | 6dfdfc46bf6fbf4514e0ec303d094dc03992a16f | |
| parent | 423996af81218d48dbeaccef52ff822e02c43128 (diff) | |
Fix flickering black square when selecting content on Windows (#1866).
| -rw-r--r-- | src/wx/audio_panel.cc | 9 | ||||
| -rw-r--r-- | src/wx/audio_panel.h | 9 | ||||
| -rw-r--r-- | src/wx/content_panel.cc | 4 | ||||
| -rw-r--r-- | src/wx/content_sub_panel.h | 2 | ||||
| -rw-r--r-- | src/wx/text_panel.cc | 11 | ||||
| -rw-r--r-- | src/wx/text_panel.h | 9 | ||||
| -rw-r--r-- | src/wx/timing_panel.cc | 9 | ||||
| -rw-r--r-- | src/wx/timing_panel.h | 1 | ||||
| -rw-r--r-- | src/wx/video_panel.cc | 9 | ||||
| -rw-r--r-- | src/wx/video_panel.h | 9 |
10 files changed, 59 insertions, 13 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index 732468c84..75659aebd 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -57,6 +57,13 @@ AudioPanel::AudioPanel (ContentPanel* p) : ContentSubPanel (p, _("Audio")) , _audio_dialog (0) { + +} + + +void +AudioPanel::create () +{ _reference = new CheckBox (this, _("Use this DCP's audio as OV and make VF")); _reference_note = new StaticText (this, wxT("")); _reference_note->Wrap (200); @@ -119,6 +126,8 @@ AudioPanel::AudioPanel (ContentPanel* p) _active_jobs_connection = JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&AudioPanel::active_jobs_changed, this, _1, _2)); add_to_grid (); + + _sizer->Layout (); } void diff --git a/src/wx/audio_panel.h b/src/wx/audio_panel.h index 0ae9da88e..5e8f92597 100644 --- a/src/wx/audio_panel.h +++ b/src/wx/audio_panel.h @@ -39,9 +39,10 @@ public: explicit AudioPanel (ContentPanel *); ~AudioPanel (); - void film_changed (Film::Property); - void film_content_changed (int); - void content_selection_changed (); + void create () override; + void film_changed (Film::Property) override; + void film_content_changed (int) override; + void content_selection_changed () override; void set_film (std::shared_ptr<Film>); private: @@ -53,7 +54,7 @@ private: void active_jobs_changed (boost::optional<std::string>, boost::optional<std::string>); void setup_sensitivity (); void reference_clicked (); - void add_to_grid (); + void add_to_grid () override; boost::optional<float> peak () const; wxCheckBox* _reference; diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index bcc699913..5ec503720 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -135,6 +135,7 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmV _timing_panel = new TimingPanel (this, _film_viewer); _notebook->AddPage (_timing_panel, _("Timing"), false); + _timing_panel->create (); _content->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind (&ContentPanel::item_selected, this)); _content->Bind (wxEVT_LIST_ITEM_DESELECTED, boost::bind (&ContentPanel::item_deselected, this)); @@ -358,6 +359,7 @@ ContentPanel::check_selection () if (have_video && !_video_panel) { _video_panel = new VideoPanel (this); _notebook->InsertPage (off, _video_panel, _video_panel->name()); + _video_panel->create (); } else if (!have_video && _video_panel) { _notebook->DeletePage (off); _video_panel = 0; @@ -370,6 +372,7 @@ ContentPanel::check_selection () if (have_audio && !_audio_panel) { _audio_panel = new AudioPanel (this); _notebook->InsertPage (off, _audio_panel, _audio_panel->name()); + _audio_panel->create (); } else if (!have_audio && _audio_panel) { _notebook->DeletePage (off); _audio_panel = 0; @@ -383,6 +386,7 @@ ContentPanel::check_selection () if (have_text[i] && !_text_panel[i]) { _text_panel[i] = new TextPanel (this, static_cast<TextType>(i)); _notebook->InsertPage (off, _text_panel[i], _text_panel[i]->name()); + _text_panel[i]->create (); } else if (!have_text[i] && _text_panel[i]) { _notebook->DeletePage (off); _text_panel[i] = 0; diff --git a/src/wx/content_sub_panel.h b/src/wx/content_sub_panel.h index 2a7bc4f75..3f8317bf9 100644 --- a/src/wx/content_sub_panel.h +++ b/src/wx/content_sub_panel.h @@ -37,6 +37,8 @@ class ContentSubPanel : public wxScrolledWindow public: ContentSubPanel (ContentPanel *, wxString); + virtual void create () = 0; + virtual void film_changed (Film::Property) {} /** Called when a given property of one of the selected Contents changes */ virtual void film_content_changed (int) = 0; diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc index 134d397e8..7bbead30c 100644 --- a/src/wx/text_panel.cc +++ b/src/wx/text_panel.cc @@ -62,8 +62,15 @@ TextPanel::TextPanel (ContentPanel* p, TextType t) : ContentSubPanel (p, std_to_wx(text_type_to_name(t))) , _original_type (t) { + +} + + +void +TextPanel::create () +{ wxString refer = _("Use this DCP's subtitle as OV and make VF"); - if (t == TextType::CLOSED_CAPTION) { + if (_original_type == TextType::CLOSED_CAPTION) { refer = _("Use this DCP's closed caption as OV and make VF"); } @@ -131,6 +138,8 @@ TextPanel::TextPanel (ContentPanel* p, TextType t) add_to_grid(); content_selection_changed (); + + _sizer->Layout (); } diff --git a/src/wx/text_panel.h b/src/wx/text_panel.h index c76449513..c4498f970 100644 --- a/src/wx/text_panel.h +++ b/src/wx/text_panel.h @@ -36,9 +36,10 @@ class TextPanel : public ContentSubPanel public: TextPanel (ContentPanel *, TextType t); - void film_changed (Film::Property); - void film_content_changed (int); - void content_selection_changed (); + void create () override; + void film_changed (Film::Property) override; + void film_content_changed (int) override; + void content_selection_changed () override; private: void use_toggled (); @@ -59,7 +60,7 @@ private: TextType current_type () const; void update_dcp_tracks (); void update_dcp_track_selection (); - void add_to_grid (); + void add_to_grid () override; void try_to_load_analysis (); void analysis_finished (); void language_changed (); diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index f251e3c93..1f2928e01 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -66,6 +66,13 @@ TimingPanel::TimingPanel (ContentPanel* p, weak_ptr<FilmViewer> viewer) , _viewer (viewer) , _film_content_changed_suspender (boost::bind(&TimingPanel::film_content_changed, this, _1)) { + +} + + +void +TimingPanel::create () +{ wxSize size = TimecodeBase::size (this); for (int i = 0; i < 3; ++i) { @@ -123,6 +130,8 @@ TimingPanel::TimingPanel (ContentPanel* p, weak_ptr<FilmViewer> viewer) setup_sensitivity (); add_to_grid (); + + _sizer->Layout (); } void diff --git a/src/wx/timing_panel.h b/src/wx/timing_panel.h index 251acc9b5..1702d93a9 100644 --- a/src/wx/timing_panel.h +++ b/src/wx/timing_panel.h @@ -29,6 +29,7 @@ class TimingPanel : public ContentSubPanel public: TimingPanel (ContentPanel *, std::weak_ptr<FilmViewer> viewer); + void create () override; void film_changed (Film::Property); void film_content_changed (int); void content_selection_changed (); diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index c5a48f986..07a929e10 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -65,6 +65,13 @@ using namespace boost::placeholders; VideoPanel::VideoPanel (ContentPanel* p) : ContentSubPanel (p, _("Video")) { + +} + + +void +VideoPanel::create () +{ _reference = new CheckBox (this, _("Use this DCP's video as OV and make VF")); _reference_note = new StaticText (this, wxT("")); _reference_note->Wrap (200); @@ -221,6 +228,8 @@ VideoPanel::VideoPanel (ContentPanel* p) _top_bottom_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::top_bottom_link_clicked, this)); add_to_grid (); + + _sizer->Layout (); } diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h index 3c51ac152..2d25f82af 100644 --- a/src/wx/video_panel.h +++ b/src/wx/video_panel.h @@ -45,9 +45,10 @@ class VideoPanel : public ContentSubPanel public: explicit VideoPanel (ContentPanel *); - void film_changed (Film::Property); - void film_content_changed (int); - void content_selection_changed (); + void create () override; + void film_changed (Film::Property) override; + void film_content_changed (int) override; + void content_selection_changed () override; private: void reference_clicked (); @@ -56,7 +57,7 @@ private: void range_changed (); void fade_in_changed (); void fade_out_changed (); - void add_to_grid (); + void add_to_grid () override; void scale_fit_clicked (); void scale_custom_clicked (); bool scale_custom_edit_clicked (); |
