summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/livepatheffect-editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/dialog/livepatheffect-editor.cpp')
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp43
1 files changed, 14 insertions, 29 deletions
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index ec8ae4f31..6cf7f807a 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -42,6 +42,7 @@
#include "object/sp-text.h"
#include "ui/icon-names.h"
+#include "ui/tools/node-tool.h"
#include "ui/widget/imagetoggler.h"
namespace Inkscape {
@@ -205,42 +206,16 @@ LivePathEffectEditor::showParams(LivePathEffect::Effect& effect)
lpe_changed = false;
return;
}
- bool expanderopen = false;
- Gtk::Widget * defaultswidget = effect.defaultParamSet();
-
if (effectwidget) {
- if (defaultswidget) {
- Gtk::Expander * expander = NULL;
- std::vector<Gtk::Widget *> childs = dynamic_cast<Gtk::Box *> (effectwidget)->get_children();
- if (childs.size()) {
- std::vector<Gtk::Widget *> childs_default = dynamic_cast<Gtk::Box *> (childs[childs.size()-1])->get_children();
- if ((expander = dynamic_cast<Gtk::Expander *>(childs_default[childs_default.size()-1]))){
- expanderopen = expander->get_expanded();
- }
- }
- }
effectcontrol_vbox.remove(*effectwidget);
delete effectwidget;
effectwidget = NULL;
}
-
+ effectwidget = effect.newWidget();
effectcontrol_frame.set_label(effect.getName());
+ effectcontrol_vbox.pack_start(*effectwidget, true, true);
- effectwidget = effect.newWidget();
- if (effectwidget) {
-
- if (defaultswidget) {
- Gtk::Expander * expander = NULL;
- std::vector<Gtk::Widget *> childs_default = dynamic_cast<Gtk::Box *> (defaultswidget)->get_children();
- if ((expander = dynamic_cast<Gtk::Expander *>(childs_default[childs_default.size()-1]))){
- expander->set_expanded(expanderopen);
- }
- dynamic_cast<Gtk::Box *> (effectwidget)->pack_start(*defaultswidget, true, true);
- }
- effectcontrol_vbox.pack_start(*effectwidget, true, true);
- }
button_remove.show();
-
status_label.hide();
effectcontrol_frame.show();
effectcontrol_vbox.show_all_children();
@@ -254,7 +229,7 @@ LivePathEffectEditor::selectInList(LivePathEffect::Effect* effect)
{
Gtk::TreeNodeChildren chi = effectlist_view.get_model()->children();
for (Gtk::TreeIter ci = chi.begin() ; ci != chi.end(); ci++) {
- if (ci->get_value(columns.lperef)->lpeobject->get_lpe() == effect)
+ if (ci->get_value(columns.lperef)->lpeobject->get_lpe() == effect && effectlist_view.get_selection())
effectlist_view.get_selection()->select(ci);
}
}
@@ -580,6 +555,16 @@ void LivePathEffectEditor::on_effect_selection_changed()
if (effect) {
lpe_changed = true;
showParams(*effect);
+ //To reload knots and helper paths
+ Inkscape::Selection *sel = _getSelection();
+ if ( sel && !sel->isEmpty() ) {
+ SPItem *item = sel->singleItem();
+ if (item) {
+ sel->clear();
+ sel->add(item);
+ Inkscape::UI::Tools::sp_update_helperpath();
+ }
+ }
}
}
}