From 646bcc68854b0c4bd0ccf5287136363a0f714130 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 23 Dec 2015 18:23:11 +0100 Subject: [PATCH] allow dragging plugins directly from the manager --- gtk2_ardour/plugin_selector.cc | 4 ++++ gtk2_ardour/plugin_selector.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index a38ad7d2e0..7d3594e4cd 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -105,6 +105,10 @@ PluginSelector::PluginSelector (PluginManager& mgr) plugin_display.set_headers_clickable (true); plugin_display.set_reorderable (false); plugin_display.set_rules_hint (true); + plugin_display.add_object_drag (plugin_columns.plugin.index(), "PluginInfoPtr"); + + // setting a sort-column prevents re-ordering via Drag/Drop + plugin_model->set_sort_column (plugin_columns.name.index(), Gtk::SORT_ASCENDING); CellRendererToggle* fav_cell = dynamic_cast(plugin_display.get_column_cell_renderer (0)); fav_cell->property_activatable() = true; diff --git a/gtk2_ardour/plugin_selector.h b/gtk2_ardour/plugin_selector.h index cb90acc2d0..a377d5b49d 100644 --- a/gtk2_ardour/plugin_selector.h +++ b/gtk2_ardour/plugin_selector.h @@ -23,6 +23,7 @@ #include #include #include +#include "gtkmm2ext/dndtreeview.h" #include #include "ardour/plugin.h" @@ -99,7 +100,7 @@ class PluginSelector : public ArdourDialog }; PluginColumns plugin_columns; Glib::RefPtr plugin_model; - Gtk::TreeView plugin_display; + Gtkmm2ext::DnDTreeView plugin_display; Gtk::Button* btn_add; Gtk::Button* btn_remove;