summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2014-02-25 01:09:35 +0000
committerMartin Owens <doctormo@gmail.com>2014-02-25 01:09:35 +0000
commitb777ba99030a6ae4b44bb0a78ce6282f2d99cbe8 (patch)
tree71db5f58e0cbeed62581a914546708ea1c29c645 /src
parentFix infinite loop (?) by disabling saving the order of filters when they are ... (diff)
downloadinkscape-b777ba99030a6ae4b44bb0a78ce6282f2d99cbe8.tar.gz
inkscape-b777ba99030a6ae4b44bb0a78ce6282f2d99cbe8.zip
Move filter reordering closer to the layers.cpp patern of reordering xml
(bzr r13056)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp11
-rw-r--r--src/ui/dialog/filter-effects-dialog.h2
2 files changed, 7 insertions, 6 deletions
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<Gdk::DragContext>& /*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<Gdk::DragContext>& /*context*/, int x, int y, guint /*time*/);
void on_selection_toggled(const Glib::ustring&);
void update_filters();