From 3103b99b4cf6c1048c89f75e280761d8cd0ca1c2 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 15 Apr 2017 00:20:13 +0200 Subject: Allow set and reset default values of LPE parameters (bzr r15620.1.1) --- src/live_effects/parameter/fontbutton.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/live_effects/parameter/fontbutton.cpp') diff --git a/src/live_effects/parameter/fontbutton.cpp b/src/live_effects/parameter/fontbutton.cpp index 64c203093..53b8c0612 100644 --- a/src/live_effects/parameter/fontbutton.cpp +++ b/src/live_effects/parameter/fontbutton.cpp @@ -33,9 +33,11 @@ FontButtonParam::param_set_default() { param_setValue(defvalue); } + void -FontButtonParam::param_update_default(const Glib::ustring default_value){ - defvalue = default_value; +FontButtonParam::param_update_default(const gchar * default_value) +{ + defvalue = (Glib::ustring)strdup(default_value); } bool @@ -63,7 +65,7 @@ FontButtonParam::param_newWidget() *param_wr, param_effect->getRepr(), param_effect->getSPDoc() ) ); - Glib::ustring fontspec = param_getSVGValue(); + Glib::ustring fontspec = (Glib::ustring)param_getSVGValue(); fontbuttonwdg->setValue( fontspec); fontbuttonwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change font button parameter")); param_effect->upd_params = false; @@ -71,11 +73,12 @@ FontButtonParam::param_newWidget() } void -FontButtonParam::param_setValue(const Glib::ustring newvalue) +FontButtonParam::param_setValue(Glib::ustring newvalue) { value = newvalue; } + } /* namespace LivePathEffect */ } /* namespace Inkscape */ -- cgit v1.2.3 From af42d5456d7f523d6cb259d0e2921234aa887146 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Thu, 27 Apr 2017 01:06:31 +0200 Subject: Add LPE prefs dialog (bzr r15620.1.4) --- src/live_effects/parameter/fontbutton.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/live_effects/parameter/fontbutton.cpp') diff --git a/src/live_effects/parameter/fontbutton.cpp b/src/live_effects/parameter/fontbutton.cpp index 53b8c0612..ee76c4ab9 100644 --- a/src/live_effects/parameter/fontbutton.cpp +++ b/src/live_effects/parameter/fontbutton.cpp @@ -58,8 +58,18 @@ FontButtonParam::param_getSVGValue() const Gtk::Widget * FontButtonParam::param_newWidget() { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring effectkey = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_key(param_effect->effectType()); + Glib::ustring pref_path = (Glib::ustring)"/live_effects/" + + effectkey + + (Glib::ustring)"/" + + (Glib::ustring)param_key; + Glib::ustring label = param_label; + if(prefs->getEntry(pref_path).isValid()){ + label = (Glib::ustring)"* " + param_label; + } Inkscape::UI::Widget::RegisteredFontButton * fontbuttonwdg = Gtk::manage( - new Inkscape::UI::Widget::RegisteredFontButton( param_label, + new Inkscape::UI::Widget::RegisteredFontButton( label, param_tooltip, param_key, *param_wr, -- cgit v1.2.3 From 52054e24f8b98c07753588c726a1e777bad7245b Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Fri, 28 Apr 2017 21:42:36 +0200 Subject: Reset (bzr r15620.1.9) --- src/live_effects/parameter/fontbutton.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/live_effects/parameter/fontbutton.cpp') diff --git a/src/live_effects/parameter/fontbutton.cpp b/src/live_effects/parameter/fontbutton.cpp index ee76c4ab9..64c203093 100644 --- a/src/live_effects/parameter/fontbutton.cpp +++ b/src/live_effects/parameter/fontbutton.cpp @@ -33,11 +33,9 @@ FontButtonParam::param_set_default() { param_setValue(defvalue); } - void -FontButtonParam::param_update_default(const gchar * default_value) -{ - defvalue = (Glib::ustring)strdup(default_value); +FontButtonParam::param_update_default(const Glib::ustring default_value){ + defvalue = default_value; } bool @@ -58,24 +56,14 @@ FontButtonParam::param_getSVGValue() const Gtk::Widget * FontButtonParam::param_newWidget() { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Glib::ustring effectkey = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_key(param_effect->effectType()); - Glib::ustring pref_path = (Glib::ustring)"/live_effects/" + - effectkey + - (Glib::ustring)"/" + - (Glib::ustring)param_key; - Glib::ustring label = param_label; - if(prefs->getEntry(pref_path).isValid()){ - label = (Glib::ustring)"* " + param_label; - } Inkscape::UI::Widget::RegisteredFontButton * fontbuttonwdg = Gtk::manage( - new Inkscape::UI::Widget::RegisteredFontButton( label, + new Inkscape::UI::Widget::RegisteredFontButton( param_label, param_tooltip, param_key, *param_wr, param_effect->getRepr(), param_effect->getSPDoc() ) ); - Glib::ustring fontspec = (Glib::ustring)param_getSVGValue(); + Glib::ustring fontspec = param_getSVGValue(); fontbuttonwdg->setValue( fontspec); fontbuttonwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change font button parameter")); param_effect->upd_params = false; @@ -83,12 +71,11 @@ FontButtonParam::param_newWidget() } void -FontButtonParam::param_setValue(Glib::ustring newvalue) +FontButtonParam::param_setValue(const Glib::ustring newvalue) { value = newvalue; } - } /* namespace LivePathEffect */ } /* namespace Inkscape */ -- cgit v1.2.3 From e5601e5e84df30c40d93271fd69cecd31391e309 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 29 Apr 2017 02:01:22 +0200 Subject: Rewrite UX (bzr r15620.1.12) --- src/live_effects/parameter/fontbutton.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/fontbutton.cpp') diff --git a/src/live_effects/parameter/fontbutton.cpp b/src/live_effects/parameter/fontbutton.cpp index 64c203093..5ec98df8c 100644 --- a/src/live_effects/parameter/fontbutton.cpp +++ b/src/live_effects/parameter/fontbutton.cpp @@ -33,9 +33,11 @@ FontButtonParam::param_set_default() { param_setValue(defvalue); } + void -FontButtonParam::param_update_default(const Glib::ustring default_value){ - defvalue = default_value; +FontButtonParam::param_update_default(const gchar * default_value) +{ + defvalue = (Glib::ustring)strdup(default_value); } bool @@ -76,6 +78,7 @@ FontButtonParam::param_setValue(const Glib::ustring newvalue) value = newvalue; } + } /* namespace LivePathEffect */ } /* namespace Inkscape */ -- cgit v1.2.3