diff options
author | Robin Gareus <robin@gareus.org> | 2015-12-30 12:13:35 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-12-30 12:25:09 +0100 |
commit | 5d8b75386c00124889c66df61fd8c4dd61a53928 (patch) | |
tree | 969057bf09761848815b89aac74f7ef5b3438bcc | |
parent | f3179cc5e3d8f32d64b3480098f6485374af9d99 (diff) |
allow to set per item drag targets
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/dndvbox.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h index a5e98daf43..aba413b352 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h @@ -87,9 +87,13 @@ public: } /** Add a child at the end of the widget. The DnDVBox will take responsibility for deleting the child */ - void add_child (T* child) + void add_child (T* child, std::list<Gtk::TargetEntry> targets = std::list<Gtk::TargetEntry>()) { - child->action_widget().drag_source_set (_targets); + if (targets.empty ()) { + child->action_widget().drag_source_set (_targets); + } else { + child->action_widget().drag_source_set (targets); + } child->action_widget().signal_drag_begin().connect (sigc::bind (mem_fun (*this, &DnDVBox::drag_begin), child)); child->action_widget().signal_drag_data_get().connect (sigc::bind (mem_fun (*this, &DnDVBox::drag_data_get), child)); child->action_widget().signal_drag_end().connect (sigc::bind (mem_fun (*this, &DnDVBox::drag_end), child)); |