summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/livepatheffect-editor.cpp
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-05-01 01:21:44 +0000
committerJabiertxof <jtx@jtx>2017-05-01 01:21:44 +0000
commit3be0cd064d48cfe0601d365fb52f729a776d462b (patch)
tree1b4f8c65753bc149ca39f7dac7b381c50351114e /src/ui/dialog/livepatheffect-editor.cpp
parentminor bugfixing (diff)
parentFix erase lpe in multi LPE mode (diff)
downloadinkscape-3be0cd064d48cfe0601d365fb52f729a776d462b.tar.gz
inkscape-3be0cd064d48cfe0601d365fb52f729a776d462b.zip
Update to trunk
(bzr r15620.1.14)
Diffstat (limited to 'src/ui/dialog/livepatheffect-editor.cpp')
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index f0ccce6d4..f3fec2df4 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -47,17 +47,18 @@ namespace Dialog {
/*####################
* Callback functions
*/
+
+
void lpeeditor_selection_changed (Inkscape::Selection * selection, gpointer data)
{
LivePathEffectEditor *lpeeditor = static_cast<LivePathEffectEditor *>(data);
lpeeditor->lpe_list_locked = false;
- lpeeditor->onSelectionChanged(selection, true);
+ lpeeditor->onSelectionChanged(selection);
}
-static void lpeeditor_selection_modified (Inkscape::Selection * selection, guint /*flags*/, gpointer data)
+void lpeeditor_selection_modified (Inkscape::Selection * selection, guint /*flags*/, gpointer data)
{
- LivePathEffectEditor *lpeeditor = static_cast<LivePathEffectEditor *>(data);
- lpeeditor->onSelectionChanged(selection);
+ lpeeditor_selection_changed (selection, data);
}
static void lpe_style_button(Gtk::Button& btn, char const* iconName)
@@ -184,15 +185,13 @@ LivePathEffectEditor::~LivePathEffectEditor()
if (current_desktop) {
selection_changed_connection.disconnect();
selection_modified_connection.disconnect();
+ selection_moved_connection.disconnect();
}
}
void
LivePathEffectEditor::showParams(LivePathEffect::Effect& effect)
{
- if ( ! effect.upd_params ) {
- return;
- }
bool expanderopen = false;
Gtk::Widget * defaultswidget = effect.defaultParamSet();
if (effectwidget) {
@@ -272,16 +271,15 @@ LivePathEffectEditor::set_sensitize_all(bool sensitive)
}
void
-LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel, bool upd_params)
+LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel)
{
if (lpe_list_locked) {
// this was triggered by selecting a row in the list, so skip reloading
lpe_list_locked = false;
return;
}
-
- effectlist_store->clear();
current_lpeitem = NULL;
+ effectlist_store->clear();
if ( sel && !sel->isEmpty() ) {
SPItem *item = sel->singleItem();
@@ -296,9 +294,6 @@ LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel, bool upd_para
if ( lpeitem->hasPathEffect() ) {
Inkscape::LivePathEffect::Effect *lpe = lpeitem->getCurrentLPE();
if (lpe) {
- if (upd_params) {
- lpe->upd_params = true;
- }
showParams(*lpe);
lpe_list_locked = true;
selectInList(lpe);
@@ -502,18 +497,12 @@ LivePathEffectEditor::onRemove()
SPItem *item = sel->singleItem();
SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
if ( lpeitem ) {
- if (current_lperef && current_lperef->lpeobject) {
- LivePathEffect::Effect * effect = current_lperef->lpeobject->get_lpe();
- if (effect) {
- effect->upd_params = true;
- }
- }
lpeitem->removeCurrentPathEffect(false);
-
+ current_lperef = NULL;
DocumentUndo::done( current_desktop->getDocument(), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Remove path effect") );
-
- effect_list_reload(lpeitem);
+ lpe_list_locked = false;
+ onSelectionChanged(sel);
}
}
@@ -530,7 +519,7 @@ void LivePathEffectEditor::onUp()
DocumentUndo::done( current_desktop->getDocument(), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Move path effect up") );
-
+
effect_list_reload(lpeitem);
}
}
@@ -547,7 +536,6 @@ void LivePathEffectEditor::onDown()
DocumentUndo::done( current_desktop->getDocument(), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Move path effect down") );
-
effect_list_reload(lpeitem);
}
}
@@ -572,7 +560,6 @@ void LivePathEffectEditor::on_effect_selection_changed()
current_lperef = lperef;
LivePathEffect::Effect * effect = lperef->lpeobject->get_lpe();
if (effect) {
- effect->upd_params = true;
showParams(*effect);
}
}
@@ -581,6 +568,7 @@ void LivePathEffectEditor::on_effect_selection_changed()
void LivePathEffectEditor::on_visibility_toggled( Glib::ustring const& str )
{
+
Gtk::TreeModel::Children::iterator iter = effectlist_view.get_model()->get_iter(str);
Gtk::TreeModel::Row row = *iter;