From b777ba99030a6ae4b44bb0a78ce6282f2d99cbe8 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Mon, 24 Feb 2014 20:09:35 -0500 Subject: Move filter reordering closer to the layers.cpp patern of reordering xml (bzr r13056) --- src/ui/dialog/filter-effects-dialog.cpp | 11 ++++++----- src/ui/dialog/filter-effects-dialog.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index e8b09db8b..b763776c6 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1363,11 +1363,9 @@ FilterEffectsDialog::FilterModifier::FilterModifier(FilterEffectsDialog& d) sw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); _list.get_column(1)->set_resizable(true); _list.set_reorderable(true); + _list.enable_model_drag_dest (Gdk::ACTION_MOVE); - // We can track the drag/drop reordering from the row_delete (occurs after - // row_inserted and may occur many times when adding a new item) - _model->signal_row_deleted().connect( - sigc::mem_fun(*this, &FilterModifier::on_filter_reorder)); + _list.signal_drag_drop().connect( sigc::mem_fun(*this, &FilterModifier::on_filter_move), false ); sw->set_shadow_type(Gtk::SHADOW_IN); show_all_children(); @@ -1514,7 +1512,9 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa } } -void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& /*path*/) { +bool FilterEffectsDialog::FilterModifier::on_filter_move(const Glib::RefPtr& /*context*/, int x, int y, guint /*time*/) { + +//const Gtk::TreeModel::Path& /*path*/) { /* The code below is bugged. Use of "object->getRepr()->setPosition(0)" is dangerous! Writing back the reordered list to XML (reordering XML nodes) should be implemented differently. Note that the dialog does also not update its list of filters when the order is manually changed @@ -1525,6 +1525,7 @@ void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel object->getRepr()->setPosition(0); } */ + return false; } void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustring& path) diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index ccf79e60d..3fc19e7de 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -86,7 +86,7 @@ private: void on_filter_selection_changed(); void on_name_edited(const Glib::ustring&, const Glib::ustring&); - void on_filter_reorder(const Gtk::TreeModel::Path& path); + bool on_filter_move(const Glib::RefPtr& /*context*/, int x, int y, guint /*time*/); void on_selection_toggled(const Glib::ustring&); void update_filters(); -- cgit v1.2.3