From 1711a79b8604d9e6d936e25eaf966154ff122483 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Fri, 22 Sep 2017 18:00:59 +0200 Subject: Add tooltip to set default LPE widget --- src/live_effects/effect.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index b2ba0acdc..dcc60af14 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -826,29 +826,36 @@ Effect::defaultParamSet() Glib::ustring * tip = param->param_getTooltip(); const gchar * key = param->param_key.c_str(); const gchar * value = param->param_label.c_str(); - const gchar * tooltip_extra = _(". Change custom values for this parameter"); - Glib::ustring tooltip = param->param_tooltip + (Glib::ustring)tooltip_extra; + Glib::ustring pref_path = (Glib::ustring)"/live_effects/" + effectkey + (Glib::ustring)"/" + (Glib::ustring)key; bool valid = prefs->getEntry(pref_path).isValid(); const gchar * set_or_upd; + Glib::ustring def = Glib::ustring(_("Default value: ")) + Glib::ustring(param->param_getDefaultSVGValue()) + Glib::ustring("\n"); + Glib::ustring ove = Glib::ustring(_("Default value overrided: ")) + Glib::ustring(prefs->getString(pref_path)) + Glib::ustring("\n"); if (valid) { set_or_upd = _("Update"); + def = Glib::ustring(_("Default value: ")) + Glib::ustring(param->param_getDefaultSVGValue()) + Glib::ustring("\n"); } else { set_or_upd = _("Set"); + ove = Glib::ustring(_("Default value overrided: None\n")); } + Glib::ustring cur = Glib::ustring(_("Current parameter value: ")) + Glib::ustring(param->param_getSVGValue()); Gtk::HBox * vbox_param = Gtk::manage( new Gtk::HBox(true) ); Gtk::Label *parameter_label = Gtk::manage(new Gtk::Label(value, Gtk::ALIGN_START)); parameter_label->set_use_markup(true); - parameter_label->set_use_underline (true); + parameter_label->set_use_underline(true); + Glib::ustring tooltip = Glib::ustring("") + parameter_label->get_text () + Glib::ustring("\n") + param->param_tooltip + Glib::ustring("\n"); parameter_label->set_ellipsize(Pango::ELLIPSIZE_END); + parameter_label->set_tooltip_markup((tooltip + def + ove + cur).c_str()); vbox_param->pack_start(*parameter_label, true, true, 2); Gtk::Button *set = Gtk::manage(new Gtk::Button((Glib::ustring)set_or_upd)); Gtk::Button *unset = Gtk::manage(new Gtk::Button(Glib::ustring(_("Unset")))); - unset->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &Effect::unsetDefaultParam), pref_path, set, unset)); - set->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &Effect::setDefaultParam), pref_path, param->param_getSVGValue(), set, unset)); + unset->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &Effect::unsetDefaultParam), pref_path, tooltip, param->param_getSVGValue(), param->param_getDefaultSVGValue(), parameter_label, set, unset)); + + set->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &Effect::setDefaultParam), pref_path, tooltip, param->param_getSVGValue(), param->param_getDefaultSVGValue(), parameter_label, set, unset)); if (!valid) { unset->set_sensitive(false); } @@ -873,23 +880,31 @@ Effect::defaultParamSet() } void -Effect::setDefaultParam(Glib::ustring pref_path, gchar * value, Gtk::Button *set , Gtk::Button *unset) +Effect::setDefaultParam(Glib::ustring pref_path, Glib::ustring tooltip, gchar * value, gchar * defvalue, Gtk::Label *parameter_label, Gtk::Button *set , Gtk::Button *unset) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(pref_path, (Glib::ustring)value); gchar * label = _("Update"); set->set_label((Glib::ustring)label); unset->set_sensitive(true); + Glib::ustring def = Glib::ustring(_("Default value: ")) + Glib::ustring(defvalue) + Glib::ustring("\n"); + Glib::ustring ove = Glib::ustring(_("Default value overrided: ")) + Glib::ustring(value) + Glib::ustring("\n"); + Glib::ustring cur = Glib::ustring(_("Current parameter value: ")) + Glib::ustring(value); + parameter_label->set_tooltip_markup((tooltip + def + ove + cur).c_str()); } void -Effect::unsetDefaultParam(Glib::ustring pref_path, Gtk::Button *set, Gtk::Button *unset) +Effect::unsetDefaultParam(Glib::ustring pref_path, Glib::ustring tooltip, gchar * value, gchar * defvalue, Gtk::Label *parameter_label, Gtk::Button *set , Gtk::Button *unset) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->remove(pref_path); gchar * label = _("Set"); set->set_label((Glib::ustring)label); unset->set_sensitive(false); + Glib::ustring def = Glib::ustring(_("Default value: ")) + Glib::ustring(defvalue) + Glib::ustring("\n"); + Glib::ustring ove = Glib::ustring(_("Default value overrided: None\n")); + Glib::ustring cur = Glib::ustring(_("Current parameter value: ")) + Glib::ustring(value); + parameter_label->set_tooltip_markup((tooltip + def + ove + cur).c_str()); } Inkscape::XML::Node *Effect::getRepr() -- cgit v1.2.3 From 89708dcf567d0de08eb59811b434c9f282768e40 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Fri, 22 Sep 2017 18:12:15 +0200 Subject: Minor tootltip tweak --- src/live_effects/effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index dcc60af14..fcb4b5cb2 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -847,7 +847,7 @@ Effect::defaultParamSet() Gtk::Label *parameter_label = Gtk::manage(new Gtk::Label(value, Gtk::ALIGN_START)); parameter_label->set_use_markup(true); parameter_label->set_use_underline(true); - Glib::ustring tooltip = Glib::ustring("") + parameter_label->get_text () + Glib::ustring("\n") + param->param_tooltip + Glib::ustring("\n"); + Glib::ustring tooltip = Glib::ustring("") + parameter_label->get_text () + Glib::ustring("\n") + param->param_tooltip + Glib::ustring("\n\n"); parameter_label->set_ellipsize(Pango::ELLIPSIZE_END); parameter_label->set_tooltip_markup((tooltip + def + ove + cur).c_str()); vbox_param->pack_start(*parameter_label, true, true, 2); -- cgit v1.2.3 From c94904488d68f4c4c97a5eedb2067d82e3859790 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sat, 30 Sep 2017 14:25:40 +0200 Subject: Improvements to meassure segments LPE and a little styling tweak to default LPE params --- src/live_effects/effect.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index fcb4b5cb2..703852881 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -873,7 +873,9 @@ Effect::defaultParamSet() expander->set_expanded(false); vbox->pack_start(*dynamic_cast (expander), true, true, 2); if (has_params) { - return dynamic_cast(vbox); + Gtk::Widget *vboxwidg = dynamic_cast(vbox); + vboxwidg->set_margin_bottom(15); + return vboxwidg; } else { return NULL; } -- cgit v1.2.3 From ad03eb3eed2ad07c086fea71326c56701f3cf6e1 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 1 Oct 2017 15:05:59 +0200 Subject: A little styling tweak to a LPE expander --- src/live_effects/effect.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 703852881..2332ab8f2 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -874,7 +874,8 @@ Effect::defaultParamSet() vbox->pack_start(*dynamic_cast (expander), true, true, 2); if (has_params) { Gtk::Widget *vboxwidg = dynamic_cast(vbox); - vboxwidg->set_margin_bottom(15); + vboxwidg->set_margin_bottom(10); + vboxwidg->set_margin_top(5); return vboxwidg; } else { return NULL; -- cgit v1.2.3 From fc21cbb9a2d2f830c217d7ea96311be36a561e62 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 1 Oct 2017 23:59:23 +0200 Subject: Add better transform handle to Clone Item LPE --- src/live_effects/effect.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 2332ab8f2..2e1160764 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -81,6 +81,7 @@ #include "display/curve.h" #include #include +#include namespace Inkscape { -- cgit v1.2.3 From ee527cbb228c6fba9c83bba5058d1a68ac647060 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sat, 14 Oct 2017 21:29:10 +0200 Subject: Fixing problems with nested LPE and convert to paths --- src/live_effects/effect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 2e1160764..5674e29dc 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -563,8 +563,8 @@ void Effect::doBeforeEffect_impl(SPLPEItem const* lpeitem) setCurrentShape(shape); doBeforeEffect(lpeitem); if (apply_to_clippath_and_mask && SP_IS_GROUP(sp_lpe_item)) { - sp_lpe_item->apply_to_clippath(sp_lpe_item); - sp_lpe_item->apply_to_mask(sp_lpe_item); + sp_lpe_item->applyToClipPath(sp_lpe_item); + sp_lpe_item->applyToMask(sp_lpe_item); } update_helperpath(); } -- cgit v1.2.3