diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-02-01 23:19:13 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-02-01 23:19:13 +0000 |
| commit | d511d6702d66b93ead66c067be239173fd2d36f2 (patch) | |
| tree | 5d9b4575fd205176bef4ce6c0983ae0831ec78b4 /src | |
| parent | c7a0c827d30b7d82ac50e4cf559be2a3606ab6c3 (diff) | |
Synchronise content list / timeline selection when the content list selection changes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/content_panel.cc | 4 | ||||
| -rw-r--r-- | src/wx/timeline.cc | 11 | ||||
| -rw-r--r-- | src/wx/timeline.h | 2 | ||||
| -rw-r--r-- | src/wx/timeline_dialog.cc | 6 | ||||
| -rw-r--r-- | src/wx/timeline_dialog.h | 2 |
5 files changed, 25 insertions, 0 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index e86550426..6b2d30b9c 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -244,6 +244,10 @@ ContentPanel::selection_changed () if (go_to) { _film_viewer->set_position (go_to.get ()); } + + if (_timeline_dialog) { + _timeline_dialog->set_selection (selected ()); + } } void diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 8a61eccb0..8dee9610f 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -462,3 +462,14 @@ Timeline::selected_content () const return sel; } + +void +Timeline::set_selection (ContentList selection) +{ + for (TimelineViewList::iterator i = _views.begin(); i != _views.end(); ++i) { + shared_ptr<TimelineContentView> cv = dynamic_pointer_cast<TimelineContentView> (*i); + if (cv) { + cv->set_selected (find (selection.begin(), selection.end(), cv->content ()) != selection.end ()); + } + } +} diff --git a/src/wx/timeline.h b/src/wx/timeline.h index e8becf906..e8ae2120f 100644 --- a/src/wx/timeline.h +++ b/src/wx/timeline.h @@ -74,6 +74,8 @@ public: return _snap; } + void set_selection (ContentList selection); + private: void paint (); void left_down (wxMouseEvent &); diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 9caa62933..f054763c8 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -94,3 +94,9 @@ TimelineDialog::film_changed (Film::Property p) _sequence_video->SetValue (film->sequence_video ()); } } + +void +TimelineDialog::set_selection (ContentList selection) +{ + _timeline.set_selection (selection); +} diff --git a/src/wx/timeline_dialog.h b/src/wx/timeline_dialog.h index b760c2c5b..bc5b7228b 100644 --- a/src/wx/timeline_dialog.h +++ b/src/wx/timeline_dialog.h @@ -29,6 +29,8 @@ class TimelineDialog : public wxDialog public: TimelineDialog (ContentPanel *, boost::shared_ptr<Film>); + void set_selection (ContentList selection); + private: void snap_toggled (); void sequence_video_toggled (); |
