mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Clean up DnD, use MIME-types
This is in preparation for allowing to drag trigger-regions or trigger-slots. Those will not use a static singleton PublicEditor API. Additionally this constrains Ardour-internal drags to Ardour (via Gtk::TARGET_SAME_APP).
This commit is contained in:
parent
1078dc7eda
commit
056189c76c
10 changed files with 32 additions and 28 deletions
|
|
@ -736,7 +736,8 @@ TriggerBoxUI::TriggerBoxUI (ArdourCanvas::Item* parent, TriggerBox& tb)
|
|||
_selection_connection = PublicEditor::instance ().get_selection ().TriggersChanged.connect (sigc::mem_fun (*this, &TriggerBoxUI::selection_changed));
|
||||
|
||||
std::vector<Gtk::TargetEntry> target_table;
|
||||
target_table.push_back (Gtk::TargetEntry ("regions"));
|
||||
target_table.push_back (Gtk::TargetEntry ("x-ardour/region.erl", Gtk::TARGET_SAME_APP));
|
||||
target_table.push_back (Gtk::TargetEntry ("x-ardour/region.esl", Gtk::TARGET_SAME_APP));
|
||||
target_table.push_back (Gtk::TargetEntry ("text/uri-list"));
|
||||
target_table.push_back (Gtk::TargetEntry ("text/plain"));
|
||||
target_table.push_back (Gtk::TargetEntry ("application/x-rootwin-drop"));
|
||||
|
|
@ -870,7 +871,7 @@ TriggerBoxUI::drag_data_received (Glib::RefPtr<Gdk::DragContext> const& context,
|
|||
context->drag_finish (false, false, time);
|
||||
return;
|
||||
}
|
||||
if (data.get_target () == X_("regions")) {
|
||||
if (data.get_target () == "x-ardour/region.erl" || data.get_target () == "x-ardour/region.esl") {
|
||||
boost::shared_ptr<Region> region = PublicEditor::instance ().get_dragged_region_from_sidebar ();
|
||||
if (region) {
|
||||
_triggerbox.set_from_selection (n, region);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue