summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/livepatheffect-editor.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-07-20 21:52:06 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-07-20 21:52:06 +0000
commit0f35ecaa930de31dc2154bf6bfff4bf6123e1b3b (patch)
treea3411c79fa4f84f0c1193e085cc723e21c0e0097 /src/ui/dialog/livepatheffect-editor.cpp
parentadd visibility icon to LPE stack dialog. not clickable yet (diff)
downloadinkscape-0f35ecaa930de31dc2154bf6bfff4bf6123e1b3b.tar.gz
inkscape-0f35ecaa930de31dc2154bf6bfff4bf6123e1b3b.zip
make visibility icon in LPE stack dialog clickable
(bzr r6379)
Diffstat (limited to 'src/ui/dialog/livepatheffect-editor.cpp')
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index 232f2ebfe..f6b997528 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -135,8 +135,7 @@ LivePathEffectEditor::LivePathEffectEditor()
//Add the visibility icon column:
Inkscape::UI::Widget::ImageToggler *eyeRenderer = manage( new Inkscape::UI::Widget::ImageToggler("visible", "hidden") );
int visibleColNum = effectlist_view.append_column("is_visible", *eyeRenderer) - 1;
-// eyeRenderer->signal_pre_toggle().connect( sigc::mem_fun(*this, &LayersPanel::_preToggle) );
-// eyeRenderer->signal_toggled().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_toggled), (int)COL_VISIBLE) );
+ eyeRenderer->signal_toggled().connect( sigc::mem_fun(*this, &LivePathEffectEditor::on_visibility_toggled) );
eyeRenderer->property_activatable() = true;
Gtk::TreeViewColumn* col = effectlist_view.get_column(visibleColNum);
if ( col ) {
@@ -414,6 +413,23 @@ 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;
+
+ LivePathEffect::LPEObjectReference * lpeobjref = row[columns.lperef];
+
+ if ( lpeobjref ) {
+ bool newValue = !row[columns.col_visible];
+ row[columns.col_visible] = newValue;
+ /* FIXME: this explicit writing to SVG is wrong. The lpe_item should have a method to disable/enable an effect within its stack.
+ * So one can call: lpe_item->setActive(lpeobjref->lpeobject); */
+ lpeobjref->lpeobject->lpe->getRepr()->setAttribute("is_visible", newValue ? "true" : "false");
+ sp_document_done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+ _("Change path effect's visibility") );
+ }
+}
} // namespace Dialog
} // namespace UI