From abda18047008ae28d9711729521fef7bbff8a241 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 26 Apr 2017 21:00:04 +0200 Subject: Start adding GUI to prefs (bzr r15620.1.3) --- src/ui/dialog/inkscape-preferences.cpp | 40 ++++++++++++++++++++++++++++++++-- src/ui/dialog/inkscape-preferences.h | 2 ++ 2 files changed, 40 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 646439613..2f962a7ac 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -27,7 +27,10 @@ #include "preferences.h" #include "verbs.h" #include "selcue.h" - +#include "live_effects/effect-enum.h" +#include "live_effects/effect.h" +#include "live_effects/lpeobject.h" +#include "sp-defs.h" #include "extension/internal/gdkpixbuf-input.h" #include "message-stack.h" #include "style.h" @@ -820,6 +823,39 @@ void InkscapePreferences::initPageUI() this->AddPage(_page_grids, _("Grids"), iter_ui, PREFS_PAGE_UI_GRIDS); initKeyboardShortcuts(iter_ui); + + _page_le.add_group_header( _("Live Effects")); + SPDocument * doc = SP_ACTIVE_DOCUMENT; + Inkscape::XML::Document *xml_doc = doc->getReprDoc(); + Inkscape::XML::Node *lpe_repr = xml_doc->createElement("inkscape:path-effect"); + lpe_repr->setAttribute("id", "deleteme"); + SPObject *lpeo = SP_OBJECT(doc->getDefs()->appendChildRepr(lpe_repr)); + Inkscape::GC::release(lpe_repr); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + for ( int le = Inkscape::LivePathEffect::EffectType::BEND_PATH; le != Inkscape::LivePathEffect::EffectType::INVALID_LPE; le++ ){ + Inkscape::LivePathEffect::EffectType lpenr = static_cast(le); + Glib::ustring effectname = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_label(lpenr); + Glib::ustring effectkey = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_key(lpenr); + bool is_text_label_lpe = effectkey == (Glib::ustring)"text_label"; + if (!effectname.empty() && !is_text_label_lpe){ + lpeo->setAttribute("effect", effectkey.c_str()); + LivePathEffectObject * lpeobj = dynamic_cast(lpeo); + Glib::ustring liveeffect = effectname +(Glib::ustring)_(":"); + _page_le.add_group_header(liveeffect.c_str()); + Inkscape::LivePathEffect::Effect* effect = Inkscape::LivePathEffect::Effect::New(lpenr, lpeobj); + std::vector param_vector = effect->getParamVector(); + std::vector::iterator it = param_vector.begin(); + while (it != param_vector.end()) { + Inkscape::LivePathEffect::Parameter * param = *it; + const gchar * key = param->param_key.c_str(); + const gchar * value = param->param_label.c_str(); + _page_le.add_group_header(value); + ++it; + } + } + } + lpeo->deleteObject(); + this->AddPage(_page_le, _("Live Effects"), iter_ui, PREFS_PAGE_UI_LE); } #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) @@ -2042,7 +2078,7 @@ bool InkscapePreferences::PresentPage(const Gtk::TreeModel::iterator& iter) _page_list.expand_row(_path_tools, false); if (desired_page >= PREFS_PAGE_TOOLS_SHAPES && desired_page <= PREFS_PAGE_TOOLS_SHAPES_SPIRAL) _page_list.expand_row(_path_shapes, false); - if (desired_page >= PREFS_PAGE_UI && desired_page <= PREFS_PAGE_UI_KEYBOARD_SHORTCUTS) + if (desired_page >= PREFS_PAGE_UI && desired_page <= PREFS_PAGE_UI_LE) _page_list.expand_row(_path_ui, false); if (desired_page >= PREFS_PAGE_BEHAVIOR && desired_page <= PREFS_PAGE_BEHAVIOR_MASKS) _page_list.expand_row(_path_behavior, false); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index e6ba4e4b2..2e42252d9 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -73,6 +73,7 @@ enum { PREFS_PAGE_UI_WINDOWS, PREFS_PAGE_UI_GRIDS, PREFS_PAGE_UI_KEYBOARD_SHORTCUTS, + PREFS_PAGE_UI_LE, PREFS_PAGE_BEHAVIOR, PREFS_PAGE_BEHAVIOR_SELECTING, PREFS_PAGE_BEHAVIOR_TRANSFORMS, @@ -187,6 +188,7 @@ protected: UI::Widget::DialogPage _page_spellcheck; UI::Widget::DialogPage _page_keyshortcuts; + UI::Widget::DialogPage _page_le; UI::Widget::PrefSpinButton _mouse_sens; UI::Widget::PrefSpinButton _mouse_thres; -- 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/ui/dialog/inkscape-preferences.cpp | 54 ++++++++++++++++++++++++++++++---- src/ui/dialog/inkscape-preferences.h | 8 +++-- 2 files changed, 54 insertions(+), 8 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 2f962a7ac..93cf5eb42 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -824,14 +824,16 @@ void InkscapePreferences::initPageUI() initKeyboardShortcuts(iter_ui); - _page_le.add_group_header( _("Live Effects")); + _page_lpe.add_group_header( _("Allow set default to this parameters:")); SPDocument * doc = SP_ACTIVE_DOCUMENT; Inkscape::XML::Document *xml_doc = doc->getReprDoc(); Inkscape::XML::Node *lpe_repr = xml_doc->createElement("inkscape:path-effect"); lpe_repr->setAttribute("id", "deleteme"); SPObject *lpeo = SP_OBJECT(doc->getDefs()->appendChildRepr(lpe_repr)); Inkscape::GC::release(lpe_repr); + Inkscape::UI::Widget::Registry * wr; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + for ( int le = Inkscape::LivePathEffect::EffectType::BEND_PATH; le != Inkscape::LivePathEffect::EffectType::INVALID_LPE; le++ ){ Inkscape::LivePathEffect::EffectType lpenr = static_cast(le); Glib::ustring effectname = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_label(lpenr); @@ -841,21 +843,63 @@ void InkscapePreferences::initPageUI() lpeo->setAttribute("effect", effectkey.c_str()); LivePathEffectObject * lpeobj = dynamic_cast(lpeo); Glib::ustring liveeffect = effectname +(Glib::ustring)_(":"); - _page_le.add_group_header(liveeffect.c_str()); Inkscape::LivePathEffect::Effect* effect = Inkscape::LivePathEffect::Effect::New(lpenr, lpeobj); std::vector param_vector = effect->getParamVector(); std::vector::iterator it = param_vector.begin(); + Gtk::VBox * vbox_expander = Gtk::manage( new Gtk::VBox() ); + vbox_expander->set_border_width(10); + vbox_expander->set_spacing(2); while (it != param_vector.end()) { Inkscape::LivePathEffect::Parameter * param = *it; const gchar * key = param->param_key.c_str(); const gchar * value = param->param_label.c_str(); - _page_le.add_group_header(value); + const gchar * tooltip = (param->param_tooltip + (Glib::ustring)_(". Toogling this widget in preferences reset custom values for this parameter")).c_str(); + Glib::ustring pref_path = (Glib::ustring)"/live_effects/" + + effectkey + + (Glib::ustring)"/" + + (Glib::ustring)key; + bool valid = prefs->getEntry(pref_path).isValid(); + bool set = false; + if(valid){ + set = true; + } + Inkscape::UI::Widget::RegisteredCheckButton * checkwdg = Gtk::manage( + new Inkscape::UI::Widget::RegisteredCheckButton( param->param_label, + param->param_tooltip, + param->param_key, + *wr, + false, + NULL, + NULL) ); + checkwdg->setActive(set); + checkwdg->setProgrammatically = false; + checkwdg->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &InkscapePreferences::defaultLpeUpdater), pref_path, checkwdg)); + vbox_expander->pack_start(*dynamic_cast (checkwdg), true, true, 2); ++it; } + + Gtk::Expander * expander = Gtk::manage(new Gtk::Expander(liveeffect)); + expander->add(*vbox_expander); + expander->set_expanded(false); + Glib::ustring tip = (Glib::ustring)_("Set defaultables parameters for ") + liveeffect; + _page_lpe.add_line( true, "", *dynamic_cast(expander), "", tip.c_str() ); } } lpeo->deleteObject(); - this->AddPage(_page_le, _("Live Effects"), iter_ui, PREFS_PAGE_UI_LE); + this->AddPage(_page_lpe, _("Live Effects"), iter_ui, PREFS_PAGE_UI_LPE); +} + +void +InkscapePreferences::defaultLpeUpdater(Glib::ustring pref_path, Inkscape::UI::Widget::RegisteredCheckButton * checkwdg) +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + if (checkwdg->get_active()) + { + prefs->setString(pref_path, "--default"); + + } else { + prefs->remove(pref_path); + } } #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) @@ -2078,7 +2122,7 @@ bool InkscapePreferences::PresentPage(const Gtk::TreeModel::iterator& iter) _page_list.expand_row(_path_tools, false); if (desired_page >= PREFS_PAGE_TOOLS_SHAPES && desired_page <= PREFS_PAGE_TOOLS_SHAPES_SPIRAL) _page_list.expand_row(_path_shapes, false); - if (desired_page >= PREFS_PAGE_UI && desired_page <= PREFS_PAGE_UI_LE) + if (desired_page >= PREFS_PAGE_UI && desired_page <= PREFS_PAGE_UI_LPE) _page_list.expand_row(_path_ui, false); if (desired_page >= PREFS_PAGE_BEHAVIOR && desired_page <= PREFS_PAGE_BEHAVIOR_MASKS) _page_list.expand_row(_path_behavior, false); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 2e42252d9..6320ff49c 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -22,6 +22,7 @@ #include #include #include "ui/widget/preferences-widget.h" +#include "ui/widget/registered-widget.h" #include "ui/widget/button.h" #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -73,7 +75,7 @@ enum { PREFS_PAGE_UI_WINDOWS, PREFS_PAGE_UI_GRIDS, PREFS_PAGE_UI_KEYBOARD_SHORTCUTS, - PREFS_PAGE_UI_LE, + PREFS_PAGE_UI_LPE, PREFS_PAGE_BEHAVIOR, PREFS_PAGE_BEHAVIOR_SELECTING, PREFS_PAGE_BEHAVIOR_TRANSFORMS, @@ -188,7 +190,7 @@ protected: UI::Widget::DialogPage _page_spellcheck; UI::Widget::DialogPage _page_keyshortcuts; - UI::Widget::DialogPage _page_le; + UI::Widget::DialogPage _page_lpe; UI::Widget::PrefSpinButton _mouse_sens; UI::Widget::PrefSpinButton _mouse_thres; @@ -492,7 +494,7 @@ protected: Gtk::TreeModel::iterator AddPage(UI::Widget::DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id); bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter); bool PresentPage(const Gtk::TreeModel::iterator& iter); - + void defaultLpeUpdater(Glib::ustring pref_path, Inkscape::UI::Widget::RegisteredCheckButton * checkwdg); static void AddSelcueCheckbox(UI::Widget::DialogPage& p, Glib::ustring const &prefs_path, bool def_value); static void AddGradientCheckbox(UI::Widget::DialogPage& p, Glib::ustring const &prefs_path, bool def_value); static void AddConvertGuidesCheckbox(UI::Widget::DialogPage& p, Glib::ustring const &prefs_path, bool def_value); -- cgit v1.2.3 From 18e032118bbb1718778c6f2e5e55cdb1723dc1ce Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 27 Apr 2017 12:05:03 +0200 Subject: Add end of preferences GUI (bzr r15620.1.6) --- src/ui/dialog/inkscape-preferences.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 93cf5eb42..2f83a08e9 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -834,7 +834,7 @@ void InkscapePreferences::initPageUI() Inkscape::UI::Widget::Registry * wr; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - for ( int le = Inkscape::LivePathEffect::EffectType::BEND_PATH; le != Inkscape::LivePathEffect::EffectType::INVALID_LPE; le++ ){ + for ( int le = Inkscape::LivePathEffect::EffectType::BEND_PATH; le != Inkscape::LivePathEffect::EffectType::INVALID_LPE; ++le){ Inkscape::LivePathEffect::EffectType lpenr = static_cast(le); Glib::ustring effectname = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_label(lpenr); Glib::ustring effectkey = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_key(lpenr); @@ -845,6 +845,9 @@ void InkscapePreferences::initPageUI() Glib::ustring liveeffect = effectname +(Glib::ustring)_(":"); Inkscape::LivePathEffect::Effect* effect = Inkscape::LivePathEffect::Effect::New(lpenr, lpeobj); std::vector param_vector = effect->getParamVector(); + if (param_vector.size() == 1) { + continue; + } std::vector::iterator it = param_vector.begin(); Gtk::VBox * vbox_expander = Gtk::manage( new Gtk::VBox() ); vbox_expander->set_border_width(10); @@ -852,8 +855,13 @@ void InkscapePreferences::initPageUI() while (it != param_vector.end()) { Inkscape::LivePathEffect::Parameter * param = *it; const gchar * key = param->param_key.c_str(); + if (strcmp(key,"is_visible") == 0 ){ + ++it; + continue; + } const gchar * value = param->param_label.c_str(); - const gchar * tooltip = (param->param_tooltip + (Glib::ustring)_(". Toogling this widget in preferences reset custom values for this parameter")).c_str(); + const gchar * tooltip_extra = _(". Toogling this check in preferences reset to default 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)"/" + @@ -865,7 +873,7 @@ void InkscapePreferences::initPageUI() } Inkscape::UI::Widget::RegisteredCheckButton * checkwdg = Gtk::manage( new Inkscape::UI::Widget::RegisteredCheckButton( param->param_label, - param->param_tooltip, + tooltip, param->param_key, *wr, false, -- cgit v1.2.3 From 7139c8a3275224df37c3e59628355f6b3e3398b4 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 27 Apr 2017 15:49:12 +0200 Subject: Fixing remove prefs (bzr r15620.1.7) --- src/ui/dialog/inkscape-preferences.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 2f83a08e9..6e12104f0 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -907,6 +907,8 @@ InkscapePreferences::defaultLpeUpdater(Glib::ustring pref_path, Inkscape::UI::Wi } else { prefs->remove(pref_path); + prefs->remove((Glib::ustring)"/live_effects/gdsgddssdggdsgdsgdsgs"); + prefs->remove((Glib::ustring)"/ddsdsdsgdsg"); } } -- 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/ui/dialog/inkscape-preferences.cpp | 94 +--------------------------------- src/ui/dialog/inkscape-preferences.h | 6 +-- 2 files changed, 3 insertions(+), 97 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 6e12104f0..646439613 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -27,10 +27,7 @@ #include "preferences.h" #include "verbs.h" #include "selcue.h" -#include "live_effects/effect-enum.h" -#include "live_effects/effect.h" -#include "live_effects/lpeobject.h" -#include "sp-defs.h" + #include "extension/internal/gdkpixbuf-input.h" #include "message-stack.h" #include "style.h" @@ -823,93 +820,6 @@ void InkscapePreferences::initPageUI() this->AddPage(_page_grids, _("Grids"), iter_ui, PREFS_PAGE_UI_GRIDS); initKeyboardShortcuts(iter_ui); - - _page_lpe.add_group_header( _("Allow set default to this parameters:")); - SPDocument * doc = SP_ACTIVE_DOCUMENT; - Inkscape::XML::Document *xml_doc = doc->getReprDoc(); - Inkscape::XML::Node *lpe_repr = xml_doc->createElement("inkscape:path-effect"); - lpe_repr->setAttribute("id", "deleteme"); - SPObject *lpeo = SP_OBJECT(doc->getDefs()->appendChildRepr(lpe_repr)); - Inkscape::GC::release(lpe_repr); - Inkscape::UI::Widget::Registry * wr; - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - - for ( int le = Inkscape::LivePathEffect::EffectType::BEND_PATH; le != Inkscape::LivePathEffect::EffectType::INVALID_LPE; ++le){ - Inkscape::LivePathEffect::EffectType lpenr = static_cast(le); - Glib::ustring effectname = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_label(lpenr); - Glib::ustring effectkey = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_key(lpenr); - bool is_text_label_lpe = effectkey == (Glib::ustring)"text_label"; - if (!effectname.empty() && !is_text_label_lpe){ - lpeo->setAttribute("effect", effectkey.c_str()); - LivePathEffectObject * lpeobj = dynamic_cast(lpeo); - Glib::ustring liveeffect = effectname +(Glib::ustring)_(":"); - Inkscape::LivePathEffect::Effect* effect = Inkscape::LivePathEffect::Effect::New(lpenr, lpeobj); - std::vector param_vector = effect->getParamVector(); - if (param_vector.size() == 1) { - continue; - } - std::vector::iterator it = param_vector.begin(); - Gtk::VBox * vbox_expander = Gtk::manage( new Gtk::VBox() ); - vbox_expander->set_border_width(10); - vbox_expander->set_spacing(2); - while (it != param_vector.end()) { - Inkscape::LivePathEffect::Parameter * param = *it; - const gchar * key = param->param_key.c_str(); - if (strcmp(key,"is_visible") == 0 ){ - ++it; - continue; - } - const gchar * value = param->param_label.c_str(); - const gchar * tooltip_extra = _(". Toogling this check in preferences reset to default 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(); - bool set = false; - if(valid){ - set = true; - } - Inkscape::UI::Widget::RegisteredCheckButton * checkwdg = Gtk::manage( - new Inkscape::UI::Widget::RegisteredCheckButton( param->param_label, - tooltip, - param->param_key, - *wr, - false, - NULL, - NULL) ); - checkwdg->setActive(set); - checkwdg->setProgrammatically = false; - checkwdg->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &InkscapePreferences::defaultLpeUpdater), pref_path, checkwdg)); - vbox_expander->pack_start(*dynamic_cast (checkwdg), true, true, 2); - ++it; - } - - Gtk::Expander * expander = Gtk::manage(new Gtk::Expander(liveeffect)); - expander->add(*vbox_expander); - expander->set_expanded(false); - Glib::ustring tip = (Glib::ustring)_("Set defaultables parameters for ") + liveeffect; - _page_lpe.add_line( true, "", *dynamic_cast(expander), "", tip.c_str() ); - } - } - lpeo->deleteObject(); - this->AddPage(_page_lpe, _("Live Effects"), iter_ui, PREFS_PAGE_UI_LPE); -} - -void -InkscapePreferences::defaultLpeUpdater(Glib::ustring pref_path, Inkscape::UI::Widget::RegisteredCheckButton * checkwdg) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (checkwdg->get_active()) - { - prefs->setString(pref_path, "--default"); - - } else { - prefs->remove(pref_path); - prefs->remove((Glib::ustring)"/live_effects/gdsgddssdggdsgdsgdsgs"); - prefs->remove((Glib::ustring)"/ddsdsdsgdsg"); - } } #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) @@ -2132,7 +2042,7 @@ bool InkscapePreferences::PresentPage(const Gtk::TreeModel::iterator& iter) _page_list.expand_row(_path_tools, false); if (desired_page >= PREFS_PAGE_TOOLS_SHAPES && desired_page <= PREFS_PAGE_TOOLS_SHAPES_SPIRAL) _page_list.expand_row(_path_shapes, false); - if (desired_page >= PREFS_PAGE_UI && desired_page <= PREFS_PAGE_UI_LPE) + if (desired_page >= PREFS_PAGE_UI && desired_page <= PREFS_PAGE_UI_KEYBOARD_SHORTCUTS) _page_list.expand_row(_path_ui, false); if (desired_page >= PREFS_PAGE_BEHAVIOR && desired_page <= PREFS_PAGE_BEHAVIOR_MASKS) _page_list.expand_row(_path_behavior, false); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 6320ff49c..e6ba4e4b2 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -22,7 +22,6 @@ #include #include #include "ui/widget/preferences-widget.h" -#include "ui/widget/registered-widget.h" #include "ui/widget/button.h" #include #include @@ -31,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -75,7 +73,6 @@ enum { PREFS_PAGE_UI_WINDOWS, PREFS_PAGE_UI_GRIDS, PREFS_PAGE_UI_KEYBOARD_SHORTCUTS, - PREFS_PAGE_UI_LPE, PREFS_PAGE_BEHAVIOR, PREFS_PAGE_BEHAVIOR_SELECTING, PREFS_PAGE_BEHAVIOR_TRANSFORMS, @@ -190,7 +187,6 @@ protected: UI::Widget::DialogPage _page_spellcheck; UI::Widget::DialogPage _page_keyshortcuts; - UI::Widget::DialogPage _page_lpe; UI::Widget::PrefSpinButton _mouse_sens; UI::Widget::PrefSpinButton _mouse_thres; @@ -494,7 +490,7 @@ protected: Gtk::TreeModel::iterator AddPage(UI::Widget::DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id); bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter); bool PresentPage(const Gtk::TreeModel::iterator& iter); - void defaultLpeUpdater(Glib::ustring pref_path, Inkscape::UI::Widget::RegisteredCheckButton * checkwdg); + static void AddSelcueCheckbox(UI::Widget::DialogPage& p, Glib::ustring const &prefs_path, bool def_value); static void AddGradientCheckbox(UI::Widget::DialogPage& p, Glib::ustring const &prefs_path, bool def_value); static void AddConvertGuidesCheckbox(UI::Widget::DialogPage& p, Glib::ustring const &prefs_path, bool def_value); -- 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/ui/dialog/livepatheffect-editor.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index e5becdb5c..455c12bc3 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -19,7 +19,7 @@ #include "livepatheffect-editor.h" #include "desktop.h" - +#include #include "document.h" #include "document-undo.h" #include "helper/action.h" @@ -193,8 +193,14 @@ LivePathEffectEditor::showParams(LivePathEffect::Effect& effect) if ( ! effect.upd_params ) { return; } - + bool expanderopen = false; if (effectwidget) { + Gtk::Expander * expander = NULL; + std::vector childs = dynamic_cast (effectwidget)->get_children(); + std::vector childs_default = dynamic_cast (childs[childs.size()-1])->get_children(); + if ((expander = dynamic_cast(childs_default[childs_default.size()-1]))){ + expanderopen = expander->get_expanded(); + } effectcontrol_vbox.remove(*effectwidget); delete effectwidget; effectwidget = NULL; @@ -204,6 +210,15 @@ LivePathEffectEditor::showParams(LivePathEffect::Effect& effect) effectwidget = effect.newWidget(); if (effectwidget) { + Gtk::Widget * defaultswidget = effect.defaultParamSet(); + if (defaultswidget) { + Gtk::Expander * expander = NULL; + std::vector childs_default = dynamic_cast (defaultswidget)->get_children(); + if ((expander = dynamic_cast(childs_default[childs_default.size()-1]))){ + expander->set_expanded(expanderopen); + } + dynamic_cast (effectwidget)->pack_start(*defaultswidget, true, true); + } effectcontrol_vbox.pack_start(*effectwidget, true, true); } button_remove.show(); -- cgit v1.2.3 From a54924aece45764357c36d22d0475ef640b75ba1 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 29 Apr 2017 16:40:51 +0200 Subject: minor bugfixing (bzr r15620.1.13) --- src/ui/dialog/livepatheffect-editor.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 455c12bc3..f0ccce6d4 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -194,12 +194,15 @@ LivePathEffectEditor::showParams(LivePathEffect::Effect& effect) return; } bool expanderopen = false; + Gtk::Widget * defaultswidget = effect.defaultParamSet(); if (effectwidget) { - Gtk::Expander * expander = NULL; - std::vector childs = dynamic_cast (effectwidget)->get_children(); - std::vector childs_default = dynamic_cast (childs[childs.size()-1])->get_children(); - if ((expander = dynamic_cast(childs_default[childs_default.size()-1]))){ - expanderopen = expander->get_expanded(); + if (defaultswidget) { + Gtk::Expander * expander = NULL; + std::vector childs = dynamic_cast (effectwidget)->get_children(); + std::vector childs_default = dynamic_cast (childs[childs.size()-1])->get_children(); + if ((expander = dynamic_cast(childs_default[childs_default.size()-1]))){ + expanderopen = expander->get_expanded(); + } } effectcontrol_vbox.remove(*effectwidget); delete effectwidget; @@ -210,7 +213,7 @@ LivePathEffectEditor::showParams(LivePathEffect::Effect& effect) effectwidget = effect.newWidget(); if (effectwidget) { - Gtk::Widget * defaultswidget = effect.defaultParamSet(); + if (defaultswidget) { Gtk::Expander * expander = NULL; std::vector childs_default = dynamic_cast (defaultswidget)->get_children(); -- cgit v1.2.3