13
0

allow dragging plugins directly from the manager

This commit is contained in:
Robin Gareus 2015-12-23 18:23:11 +01:00
parent 80028d7c82
commit 646bcc6885
2 changed files with 6 additions and 1 deletions

View File

@ -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<CellRendererToggle*>(plugin_display.get_column_cell_renderer (0));
fav_cell->property_activatable() = true;

View File

@ -23,6 +23,7 @@
#include <gtkmm/dialog.h>
#include <gtkmm/notebook.h>
#include <gtkmm/treeview.h>
#include "gtkmm2ext/dndtreeview.h"
#include <gtkmm2ext/selector.h>
#include "ardour/plugin.h"
@ -99,7 +100,7 @@ class PluginSelector : public ArdourDialog
};
PluginColumns plugin_columns;
Glib::RefPtr<Gtk::ListStore> plugin_model;
Gtk::TreeView plugin_display;
Gtkmm2ext::DnDTreeView<ARDOUR::PluginInfoPtr> plugin_display;
Gtk::Button* btn_add;
Gtk::Button* btn_remove;