Fix Trigger DnD
Revert parts of8c144d6e69
and0f4a5f2d52
Allow to drag regions out of trigger-boxes (this will be needed to export triggers).
This commit is contained in:
parent
15bb91cf4f
commit
c9e9843a9e
@ -803,11 +803,15 @@ TriggerEntry::drag_data_get (Glib::RefPtr<Gdk::DragContext> const&, Gtk::Selecti
|
|||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (data.get_target () != "x-ardour/trigger.pbdid") {
|
if (data.get_target () == "x-ardour/region.pbdid") {
|
||||||
return;
|
boost::shared_ptr<Region> region = trigger ()->region ();
|
||||||
|
if (region) {
|
||||||
|
data.set (data.get_target (), region->id ().to_s ());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (data.get_target () == "x-ardour/trigger.pbdid") {
|
||||||
data.set (data.get_target (), trigger()->id ().to_s ());
|
data.set (data.get_target (), trigger()->id ().to_s ());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***************************************************** */
|
/* ***************************************************** */
|
||||||
@ -832,6 +836,7 @@ TriggerBoxUI::TriggerBoxUI (ArdourCanvas::Item* parent, TriggerBox& tb)
|
|||||||
if (!_dnd_src) {
|
if (!_dnd_src) {
|
||||||
std::vector<Gtk::TargetEntry> source_table;
|
std::vector<Gtk::TargetEntry> source_table;
|
||||||
source_table.push_back (Gtk::TargetEntry ("x-ardour/trigger.pbdid", Gtk::TARGET_SAME_APP));
|
source_table.push_back (Gtk::TargetEntry ("x-ardour/trigger.pbdid", Gtk::TARGET_SAME_APP));
|
||||||
|
source_table.push_back (Gtk::TargetEntry ("x-ardour/region.pbdid", Gtk::TARGET_SAME_APP));
|
||||||
_dnd_src = Gtk::TargetList::create (source_table);
|
_dnd_src = Gtk::TargetList::create (source_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,11 +934,9 @@ TriggerBoxUI::drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, int, i
|
|||||||
std::string target = gtkcanvas->drag_dest_find_target (context, gtkcanvas->drag_dest_get_target_list ());
|
std::string target = gtkcanvas->drag_dest_find_target (context, gtkcanvas->drag_dest_get_target_list ());
|
||||||
|
|
||||||
if ((target == "x-ardour/region.pbdid") || (target == "x-ardour/trigger.pbdid")) {
|
if ((target == "x-ardour/region.pbdid") || (target == "x-ardour/trigger.pbdid")) {
|
||||||
can_drop &= PublicEditor::instance ().pbdid_dragged_dt == _triggerbox.data_type ();
|
can_drop = PublicEditor::instance ().pbdid_dragged_dt == _triggerbox.data_type ();
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: currently for a 'plain' list of paths we are unable to report to the user if the slot can accept it.
|
|
||||||
|
|
||||||
uint64_t n = slot_at_y (y);
|
uint64_t n = slot_at_y (y);
|
||||||
if (n >= _slots.size ()) {
|
if (n >= _slots.size ()) {
|
||||||
assert (0);
|
assert (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user