diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-07-08 00:07:12 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-07-08 00:07:12 +0100 |
| commit | e0da7a310a9e7f05c7c75fa7b39f1fb110567d60 (patch) | |
| tree | 2a0b604b4278fd2dcd31885a596516deab0b43ca | |
| parent | cf693669efd43c0ac565c61a074a1c7f0290921e (diff) | |
Fix flicker in timeline view when selecting (in some cases).
| -rw-r--r-- | src/wx/content_panel.cc | 10 | ||||
| -rw-r--r-- | src/wx/content_panel.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 41a18f4b4..a860b0079 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -89,6 +89,7 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmV , _film_viewer (viewer) , _generally_sensitive (true) , _ignore_deselect (false) + , _no_check_selection (false) { for (int i = 0; i < TEXT_COUNT; ++i) { _text_panel[i] = 0; @@ -303,6 +304,10 @@ ContentPanel::check_selection () return; } + if (_no_check_selection) { + return; + } + _last_selected = selected (); setup_sensitivity (); @@ -662,6 +667,8 @@ ContentPanel::set_selection (weak_ptr<Content> wc) void ContentPanel::set_selection (ContentList cl) { + _no_check_selection = true; + ContentList content = _film->content (); for (size_t i = 0; i < content.size(); ++i) { if (find(cl.begin(), cl.end(), content[i]) != cl.end()) { @@ -670,6 +677,9 @@ ContentPanel::set_selection (ContentList cl) _content->SetItemState (i, 0, wxLIST_STATE_SELECTED); } } + + _no_check_selection = false; + check_selection (); } void diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index 8277b7c42..761b34a24 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -124,4 +124,5 @@ private: boost::weak_ptr<FilmViewer> _film_viewer; bool _generally_sensitive; bool _ignore_deselect; + bool _no_check_selection; }; |
