summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-07-30 02:34:04 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-07-30 02:34:04 +0000
commit63f6215b788d6ec422668ff764a657b310b1d7f8 (patch)
tree2faa354c49f02c0dd217bcdef803eff362a29a86 /src/ui
parentKhmer translation updated (diff)
downloadinkscape-63f6215b788d6ec422668ff764a657b310b1d7f8.tar.gz
inkscape-63f6215b788d6ec422668ff764a657b310b1d7f8.zip
fix invisible selection in the list; remove stripes; fix undo comment
(bzr r6468)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp24
-rw-r--r--src/ui/dialog/livepatheffect-editor.h3
2 files changed, 25 insertions, 2 deletions
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index f6b997528..567ee24da 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -69,6 +69,7 @@ static void lpeeditor_selection_modified (Inkscape::Selection * selection, guint
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),
@@ -125,7 +126,6 @@ LivePathEffectEditor::LivePathEffectEditor()
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
@@ -196,6 +196,17 @@ LivePathEffectEditor::showParams(LivePathEffect::Effect* effect)
}
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)
{
if (effectwidget) {
@@ -225,6 +236,12 @@ LivePathEffectEditor::set_sensitize_all(bool sensitive)
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;
@@ -243,6 +260,8 @@ LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel)
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"));
}
@@ -408,6 +427,7 @@ void LivePathEffectEditor::on_effect_selection_changed()
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);
}
@@ -427,7 +447,7 @@ void LivePathEffectEditor::on_visibility_toggled( Glib::ustring const& str )
* 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"));
}
}
diff --git a/src/ui/dialog/livepatheffect-editor.h b/src/ui/dialog/livepatheffect-editor.h
index be636ba2a..a924ed6e9 100644
--- a/src/ui/dialog/livepatheffect-editor.h
+++ b/src/ui/dialog/livepatheffect-editor.h
@@ -55,6 +55,7 @@ private:
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);
@@ -82,6 +83,8 @@ private:
Gtk::TreeModelColumn<bool> col_visible;
};
+ bool lpe_list_locked;
+
Inkscape::UI::Widget::ComboBoxEnum<LivePathEffect::EffectType> combo_effecttype;
Gtk::Widget * effectwidget;