From: Carl Hetherington Date: Mon, 26 Sep 2016 11:33:40 +0000 (+0100) Subject: Fix multi-select in the timeline (#954). X-Git-Tag: v2.9.28~29 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=f68a5f1ddd60ade2ed9a68d180ecf553e94b853f;p=dcpomatic.git Fix multi-select in the timeline (#954). --- diff --git a/ChangeLog b/ChangeLog index 271b6dec3..46f74aeea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2016-09-26 c.hetherington + * Fix multi-select in the timeline (#954). + * Add option to Windows installer to add desktop shortcuts (#965). * Updated zh_CN translation from 刘汉源. diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index b28d9ca22..7bea51687 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -465,6 +465,19 @@ ContentPanel::set_selection (weak_ptr wc) } } +void +ContentPanel::set_selection (ContentList cl) +{ + ContentList content = _film->content (); + for (size_t i = 0; i < content.size(); ++i) { + if (find(cl.begin(), cl.end(), content[i]) != cl.end()) { + _content->SetItemState (i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + } else { + _content->SetItemState (i, 0, wxLIST_STATE_SELECTED); + } + } +} + void ContentPanel::film_content_changed (int property) { diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index e1a66770c..e8b31b7f4 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -48,6 +48,7 @@ public: void set_film (boost::shared_ptr); void set_general_sensitivity (bool s); void set_selection (boost::weak_ptr); + void set_selection (ContentList cl); void film_changed (Film::Property p); void film_content_changed (int p); diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 30c2dbddc..f93953737 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -383,9 +383,9 @@ Timeline::left_up (wxMouseEvent& ev) if (_down_view) { _down_view->content()->set_change_signals_frequent (false); - _content_panel->set_selection (_down_view->content ()); } + _content_panel->set_selection (selected_content ()); set_position_from_event (ev); /* Clear up up the stuff we don't do during drag */