From: johanengelen Date: Sun, 20 Jul 2008 21:10:46 +0000 (+0000) Subject: add visibility icon to LPE stack dialog. not clickable yet X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b3722066cc416b6582d9a9a3ffc8ba2e868e102c;p=inkscape.git add visibility icon to LPE stack dialog. not clickable yet --- diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index f46a6bc95..232f2ebfe 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -17,6 +17,7 @@ #include #include "livepatheffect-editor.h" +#include "ui/widget/imagetoggler.h" #include "verbs.h" #include "selection.h" #include "sp-shape.h" @@ -131,9 +132,19 @@ LivePathEffectEditor::LivePathEffectEditor() effectlist_selection = effectlist_view.get_selection(); effectlist_selection->signal_changed().connect( sigc::mem_fun(*this, &LivePathEffectEditor::on_effect_selection_changed) ); - //Add the TreeView's view columns: - effectlist_view.append_column("Effect", columns.col_name); + //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->property_activatable() = true; + Gtk::TreeViewColumn* col = effectlist_view.get_column(visibleColNum); + if ( col ) { + col->add_attribute( eyeRenderer->property_active(), columns.col_visible ); + } + //Add the effect name column: + effectlist_view.append_column("Effect", columns.col_name); contents->pack_start(effectapplication_frame, false, false); contents->pack_start(effectlist_frame, true, true); @@ -269,6 +280,7 @@ LivePathEffectEditor::effect_list_reload(SPLPEItem *lpeitem) Gtk::TreeModel::Row row = *(effectlist_store->append()); row[columns.col_name] = (*it)->lpeobject->lpe->getName(); row[columns.lperef] = *it; + row[columns.col_visible] = (*it)->lpeobject->lpe->isVisible(); } } diff --git a/src/ui/dialog/livepatheffect-editor.h b/src/ui/dialog/livepatheffect-editor.h index 76ee9f09c..61378f329 100644 --- a/src/ui/dialog/livepatheffect-editor.h +++ b/src/ui/dialog/livepatheffect-editor.h @@ -73,11 +73,13 @@ private: { add(col_name); add(lperef); + add(col_visible); } virtual ~ModelColumns() {} Gtk::TreeModelColumn col_name; Gtk::TreeModelColumn lperef; + Gtk::TreeModelColumn col_visible; }; Inkscape::UI::Widget::ComboBoxEnum combo_effecttype;