diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-08-28 22:19:09 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-08-28 22:19:09 +0000 |
| commit | 1cece014ec24ec8447917fa31029fc70fab69a77 (patch) | |
| tree | 0410f1d6dbf8f18434309301df4d1827a8faa476 /src/ui/dialog/inkscape-preferences.cpp | |
| parent | Allow pressure in pencil in the tree modes, bezier, bspline and spiro (diff) | |
| download | inkscape-1cece014ec24ec8447917fa31029fc70fab69a77.tar.gz inkscape-1cece014ec24ec8447917fa31029fc70fab69a77.zip | |
Parametrice into preferences magic numbers and other staff
Diffstat (limited to 'src/ui/dialog/inkscape-preferences.cpp')
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 13729cf0f..4c62cca91 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -202,6 +202,40 @@ void InkscapePreferences::AddBaseSimplifySpinbutton(DialogPage &p, Glib::ustring false ); } +void InkscapePreferences::AddPressureSensibility(DialogPage &p, Glib::ustring const &prefs_path, double def_value) +{ + PrefSpinButton* sb = Gtk::manage( new PrefSpinButton); + sb->init ( prefs_path + "/pressure-sensibility", 1, 100.0, 1.0, 10.0, def_value, true, false); + p.add_line( false, _("Pressure sensibility:"), *sb, _("on tablet usage"), + _("Pressure sensibility, 12 is a good value"), + false ); +} + +void InkscapePreferences::AddPowerStrokeKnotDistanceFactor(DialogPage &p, Glib::ustring const &prefs_path, double def_value) +{ + PrefSpinButton* sb = Gtk::manage( new PrefSpinButton); + sb->init ( prefs_path + "/knots-distance", 0.1, 9999.0, 1.0, 10.0, def_value, false, false); + p.add_line( false, _("Pressure min knot distance factor:"), *sb, _("on tablet usage"), + _("Min distance between knots, this is a factor computed by zoom so 135 give good results"), + false ); +} + +void InkscapePreferences::AddPowerStrokeGapPressureFactor(DialogPage &p, Glib::ustring const &prefs_path, double def_value) +{ + PrefSpinButton* sb = Gtk::manage( new PrefSpinButton); + sb->init ( prefs_path + "/gap-pressure", 0.01, 9999.0, 1.0, 10.0, def_value, false, false); + p.add_line( false, _("Pressure inputs difference for made knots:"), *sb, _("on tablet usage"), + _("Diference between input pressure to make a powerstroke knot, 1 is a good value"), + false ); +} + +void InkscapePreferences::AddPowerStrokeUseOptimusValues(DialogPage &p, Glib::ustring const &prefs_path, bool def_value) +{ + PrefCheckButton* cb = Gtk::manage( new PrefCheckButton); + cb->init ( _("Use optimiced powerstroke values instead the default ones:"), prefs_path + "/optimus-powerstroke", def_value); + p.add_line( false, "", *cb, "", _("Use optimized powerstroke parameters values in pencil tool por pressure inputs instead the default ones")); +} + static void StyleFromSelectionToTool(Glib::ustring const &prefs_path, StyleSwatch *swatch) { @@ -421,6 +455,12 @@ void InkscapePreferences::initPageTools() this->AddNewObjectsStyle(_page_pencil, "/tools/freehand/pencil"); this->AddDotSizeSpinbutton(_page_pencil, "/tools/freehand/pencil", 3.0); this->AddBaseSimplifySpinbutton(_page_pencil, "/tools/freehand/pencil", 25.0); + _page_pencil.add_group_header( _("Pencil pressure")); + this->AddPowerStrokeUseOptimusValues(_page_pencil, "/tools/freehand/pencil", true); + this->AddPressureSensibility(_page_pencil, "/tools/freehand/pencil", 12.0); + this->AddPowerStrokeKnotDistanceFactor(_page_pencil, "/tools/freehand/pencil", 135.0); + this->AddPowerStrokeGapPressureFactor(_page_pencil, "/tools/freehand/pencil", 1.0); + _page_pencil.add_group_header( _("Sketch mode")); _page_pencil.add_line( true, "", _pencil_average_all_sketches, "", _("If on, the sketch result will be the normal average of all sketches made, instead of averaging the old result with the new sketch")); |
