summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f47ec2)
raw | patch | inline | side by side (parent: 4f47ec2)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 30 Jul 2008 02:34:04 +0000 (02:34 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 30 Jul 2008 02:34:04 +0000 (02:34 +0000) |
src/ui/dialog/livepatheffect-editor.cpp | patch | blob | history | |
src/ui/dialog/livepatheffect-editor.h | patch | blob | history |
index f6b9975282cd6cd638747fc24783cddc783a3937..567ee24dadf47ada4130dd7d0b7e0c0a7166dbb6 100644 (file)
LivePathEffectEditor::LivePathEffectEditor()
: UI::Widget::Panel("", "dialogs.livepatheffect", SP_VERB_DIALOG_LIVE_PATH_EFFECT),
+ lpe_list_locked(false),
combo_effecttype(Inkscape::LivePathEffect::LPETypeConverter),
effectwidget(NULL),
explain_label("", Gtk::ALIGN_CENTER),
effectlist_store = Gtk::ListStore::create(columns);
effectlist_view.set_model(effectlist_store);
- effectlist_view.set_rules_hint();
effectlist_view.set_headers_visible(false);
// Handle tree selections
// fixme: add resizing of dialog
}
+void
+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->lpe == effect)
+ effectlist_view.get_selection()->select(ci);
+ }
+}
+
+
void
LivePathEffectEditor::showText(Glib::ustring const &str)
{
void
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;
Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(lpeitem);
if (lpe) {
showParams(lpe);
+ lpe_list_locked = true;
+ selectInList(lpe);
} else {
showText(_("Unknown effect is applied"));
}
LivePathEffect::LPEObjectReference * lperef = (*it)[columns.lperef];
if (lperef && current_lpeitem) {
+ lpe_list_locked = true; // prevent reload of the list which would lose selection
sp_lpe_item_set_current_path_effect(current_lpeitem, lperef);
showParams(lperef->lpeobject->lpe);
}
* 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") );
+ newValue ? _("Activate path effect") : _("Deactivate path effect"));
}
}
index be636ba2a90d9aa42b89fae6c3149a4acd160276..a924ed6e9507d9fe01d5aedc306d7bd1acdebc09 100644 (file)
void showParams(LivePathEffect::Effect* effect);
void showText(Glib::ustring const &str);
+ void selectInList(LivePathEffect::Effect* effect);
// void add_entry(const char* name );
void effect_list_reload(SPLPEItem *lpeitem);
Gtk::TreeModelColumn<bool> col_visible;
};
+ bool lpe_list_locked;
+
Inkscape::UI::Widget::ComboBoxEnum<LivePathEffect::EffectType> combo_effecttype;
Gtk::Widget * effectwidget;