summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2015-07-24 19:38:06 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2015-07-24 19:38:06 +0000
commitf873250f0c426d7b281acd37d65c4e549eb204a3 (patch)
tree384b4f74b13edfdfc67b2faf150d422277a05d63 /src/ui
parentFix a bug continuing a bezier path whith a LPE one like spiro or bspline on a... (diff)
downloadinkscape-f873250f0c426d7b281acd37d65c4e549eb204a3.tar.gz
inkscape-f873250f0c426d7b281acd37d65c4e549eb204a3.zip
Make persistence of snap indicator configurable, and clean up the snapping tab in the preferences dialog
Fixed bugs: - https://launchpad.net/bugs/1420301 (bzr r14253)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp26
-rw-r--r--src/ui/dialog/inkscape-preferences.h1
-rw-r--r--src/ui/tools/tool-base.h7
-rw-r--r--src/ui/widget/preferences-widget.cpp1
-rw-r--r--src/ui/widget/preferences-widget.h1
5 files changed, 28 insertions, 8 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 3b0731953..98695e080 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1229,26 +1229,38 @@ void InkscapePreferences::initPageBehavior()
this->AddPage(_page_scrolling, _("Scrolling"), iter_behavior, PREFS_PAGE_BEHAVIOR_SCROLLING);
// Snapping options
+ _page_snapping.add_group_header( _("Snap indicator"));
+
_snap_indicator.init( _("Enable snap indicator"), "/options/snapindicator/value", true);
- _page_snapping.add_line( false, "", _snap_indicator, "",
+ _page_snapping.add_line( true, "", _snap_indicator, "",
_("After snapping, a symbol is drawn at the point that has snapped"));
- _snap_delay.init("/options/snapdelay/value", 0, 1000, 50, 100, 300, 0);
- _page_snapping.add_line( false, _("_Delay (in ms):"), _snap_delay, "",
- _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate."), true);
+ _snap_indicator.changed_signal.connect( sigc::mem_fun(_snap_persistence, &Gtk::Widget::set_sensitive) );
+
+ _snap_persistence.init("/options/snapindicatorpersistence/value", 0.1, 10, 0.1, 1, 2, 1);
+ _page_snapping.add_line( true, _("Snap indicator persistence (in seconds):"), _snap_persistence, "",
+ _("Controls how long the snap indicator message will be shown, before it disappears"), true);
+
+ _page_snapping.add_group_header( _("What should snap"));
_snap_closest_only.init( _("Only snap the node closest to the pointer"), "/options/snapclosestonly/value", false);
- _page_snapping.add_line( false, "", _snap_closest_only, "",
+ _page_snapping.add_line( true, "", _snap_closest_only, "",
_("Only try to snap the node that is initially closest to the mouse pointer"));
_snap_weight.init("/options/snapweight/value", 0, 1, 0.1, 0.2, 0.5, 1);
- _page_snapping.add_line( false, _("_Weight factor:"), _snap_weight, "",
+ _page_snapping.add_line( true, _("_Weight factor:"), _snap_weight, "",
_("When multiple snap solutions are found, then Inkscape can either prefer the closest transformation (when set to 0), or prefer the node that was initially the closest to the pointer (when set to 1)"), true);
_snap_mouse_pointer.init( _("Snap the mouse pointer when dragging a constrained knot"), "/options/snapmousepointer/value", false);
- _page_snapping.add_line( false, "", _snap_mouse_pointer, "",
+ _page_snapping.add_line( true, "", _snap_mouse_pointer, "",
_("When dragging a knot along a constraint line, then snap the position of the mouse pointer instead of snapping the projection of the knot onto the constraint line"));
+ _page_snapping.add_group_header( _("Delayed snap"));
+
+ _snap_delay.init("/options/snapdelay/value", 0, 1, 0.1, 0.2, 0.3, 1);
+ _page_snapping.add_line( true, _("Delay (in seconds):"), _snap_delay, "",
+ _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate."), true);
+
this->AddPage(_page_snapping, _("Snapping"), iter_behavior, PREFS_PAGE_BEHAVIOR_SNAPPING);
// Steps options
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index dcea91741..7e0184c55 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -322,6 +322,7 @@ protected:
UI::Widget::PrefCheckButton _importexport_import_res_override;
UI::Widget::PrefSlider _snap_delay;
UI::Widget::PrefSlider _snap_weight;
+ UI::Widget::PrefSlider _snap_persistence;
UI::Widget::PrefCheckButton _font_dialog;
UI::Widget::PrefCombo _font_unit_type;
UI::Widget::PrefCheckButton _font_output_px;
diff --git a/src/ui/tools/tool-base.h b/src/ui/tools/tool-base.h
index 7a6ab83e7..58eb6f88e 100644
--- a/src/ui/tools/tool-base.h
+++ b/src/ui/tools/tool-base.h
@@ -75,7 +75,12 @@ public:
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
double value = prefs->getDoubleLimited("/options/snapdelay/value", 0, 0, 1000);
- _timer_id = g_timeout_add(value, &sp_event_context_snap_watchdog_callback, this);
+ // We used to have this specified in milliseconds; this has changed to seconds now for consistency's sake
+ if (value > 1) { // Apparently we have an old preference file, this value must have been in milliseconds;
+ value = value / 1000.0; // now convert this value to seconds
+ }
+
+ _timer_id = g_timeout_add(value*1000.0, &sp_event_context_snap_watchdog_callback, this);
_event = gdk_event_copy((GdkEvent*) event);
((GdkEventMotion *)_event)->time = GDK_CURRENT_TIME;
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index 72597e4d9..e906762e3 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -205,6 +205,7 @@ void PrefCheckButton::init(Glib::ustring const &label, Glib::ustring const &pref
void PrefCheckButton::on_toggled()
{
+ this->changed_signal.emit(this->get_active());
if (this->get_visible()) //only take action if the user toggled it
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h
index 8b75b8368..1d2d77699 100644
--- a/src/ui/widget/preferences-widget.h
+++ b/src/ui/widget/preferences-widget.h
@@ -59,6 +59,7 @@ class PrefCheckButton : public Gtk::CheckButton
public:
void init(Glib::ustring const &label, Glib::ustring const &prefs_path,
bool default_value);
+ sigc::signal<void, bool> changed_signal;
protected:
Glib::ustring _prefs_path;
void on_toggled();