summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-02-25 09:23:36 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-02-25 09:23:36 +0000
commit63ea2ee830a7e94007c59724e736af8b32c14cf9 (patch)
tree1c5aba4b6a65042d7fb0d4051385620600562bcc /src/ui/dialog
parentupdate to trunk (diff)
parentMove filter reordering closer to the layers.cpp patern of reordering xml (diff)
downloadinkscape-63ea2ee830a7e94007c59724e736af8b32c14cf9.tar.gz
inkscape-63ea2ee830a7e94007c59724e736af8b32c14cf9.zip
update to trunk
(bzr r11950.1.256)
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp18
-rw-r--r--src/ui/dialog/filter-effects-dialog.h2
2 files changed, 13 insertions, 7 deletions
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 6a3a4c3f1..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,12 +1512,20 @@ 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
+ using the XML dialog
for(Gtk::TreeModel::iterator i = _model->children().begin(); i != _model->children().end(); ++i) {
SPObject* object = (*i)[_columns.filter];
- if(object && object->getRepr())
+ if(object && object->getRepr()) ;
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();