Code

add visibility icon to LPE stack dialog. not clickable yet
authorjohanengelen <johanengelen@users.sourceforge.net>
Sun, 20 Jul 2008 21:10:46 +0000 (21:10 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sun, 20 Jul 2008 21:10:46 +0000 (21:10 +0000)
src/ui/dialog/livepatheffect-editor.cpp
src/ui/dialog/livepatheffect-editor.h

index f46a6bc95ccd5d5c9f93c9378c0bd997590b3704..232f2ebfe7f0b40217602643d7990faa80d5f89e 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <glibmm/i18n.h>
 #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();
     }
 }
 
index 76ee9f09c8a2d1afc514aa9290d2fa163dc2e977..61378f329c6b5f3db01608f37c7055ed447a10d5 100644 (file)
@@ -73,11 +73,13 @@ private:
         {
             add(col_name);
             add(lperef);
+            add(col_visible);
         }
         virtual ~ModelColumns() {}
 
         Gtk::TreeModelColumn<Glib::ustring> col_name;
         Gtk::TreeModelColumn<LivePathEffect::LPEObjectReference *> lperef;
+        Gtk::TreeModelColumn<bool> col_visible;
     };
 
     Inkscape::UI::Widget::ComboBoxEnum<LivePathEffect::EffectType> combo_effecttype;