diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2007-08-03 19:59:25 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2007-08-03 19:59:25 +0000 |
| commit | 02a4d581812a5286809e74dc975441e5327707f1 (patch) | |
| tree | 10e4a588e05166457aebb0ee69f801368aa66e16 /src/ui | |
| parent | fix compile (diff) | |
| download | inkscape-02a4d581812a5286809e74dc975441e5327707f1.tar.gz inkscape-02a4d581812a5286809e74dc975441e5327707f1.zip | |
Rearrange snapping preferences, put distinction between paths and nodes back in, and a bit of refactoring
(bzr r3361)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 31 | ||||
| -rw-r--r-- | src/ui/dialog/document-properties.h | 2 | ||||
| -rw-r--r-- | src/ui/widget/tolerance-slider.cpp | 18 |
3 files changed, 42 insertions, 9 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 3a8623852..807d4129f 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -265,24 +265,38 @@ void DocumentProperties::build_snap() { _page_snap.show(); - _rcbsnbb.init (_("Snap bounding _boxes"), + //General options + _rcbsnbb.init (_("Snap bounding _box corners"), _("Snap bounding box corners to grid lines, to guides, and to other bounding boxes"), "inkscape:snap-bbox", _wr); _rcbsnn.init (_("Snap _nodes"), _("Snap nodes to grid lines, to guides, to paths, and to other nodes"), "inkscape:snap-nodes", _wr); - _rsu_sno.init (_("Snap s_ensitivity:"), _("Always snap"), + + //Options for snapping to objects + _rcbsnop.init (_("Snap to _paths"), + _("Snap nodes to object paths"), + "inkscape:object-paths", _wr); + _rcbsnon.init (_("Snap to n_odes"), + _("Snap nodes to object nodes"), + "inkscape:object-nodes", _wr); + _rsu_sno.init (_(" Snap _distance"), _("Snap at any dist_ance"), _("Snapping distance, in screen pixels, for snapping to objects"), _("If set, objects snap to the nearest object, regardless of distance"), "objecttolerance", _wr); - _rsu_sn.init (_("Snap sens_itivity:"), _("Always snap"), + + //Options for snapping to grids + _rsu_sn.init (_(" Snap d_istance"), _("Snap at any distan_ce"), _("Snapping distance, in screen pixels, for snapping to grid"), _("If set, objects snap to the nearest grid line, regardless of distance"), "gridtolerance", _wr); - _rsu_gusn.init (_("Snap sensiti_vity:"), _("Always snap"), + + //Options for snapping to guides + _rsu_gusn.init (_(" Snap di_stance"), _("Snap at any distanc_e"), _("Snapping distance, in screen pixels, for snapping to guides"), _("If set, objects snap to the nearest guide, regardless of distance"), "guidetolerance", _wr); + Gtk::Label *label_g = manage (new Gtk::Label); label_g->set_markup (_("<b>General</b>")); Gtk::Label *label_o = manage (new Gtk::Label); @@ -295,9 +309,12 @@ DocumentProperties::build_snap() Gtk::Widget *const array[] = { label_g, 0, + 0, _rcbsnn._button, 0, _rcbsnbb._button, - 0, _rcbsnn._button, + 0, 0, label_o, 0, + 0, _rcbsnop._button, + 0, _rcbsnon._button, 0, _rsu_sno._vbox, 0, 0, label_gr, 0, @@ -416,7 +433,9 @@ DocumentProperties::update() //-----------------------------------------------------------snap _rcbsnbb.setActive (nv->snap_manager.getSnapModeBBox()); - _rcbsnn.setActive (nv->snap_manager.getSnapModeNodes()); + _rcbsnn.setActive (nv->snap_manager.getSnapModeNode()); + _rcbsnop.setActive(nv->snap_manager.object.getSnapToItemPath()); + _rcbsnon.setActive(nv->snap_manager.object.getSnapToItemNode()); _rsu_sno.setValue (nv->objecttolerance); _rsu_sn.setValue (nv->gridtolerance); diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h index f405e71a3..d2f8776e4 100644 --- a/src/ui/dialog/document-properties.h +++ b/src/ui/dialog/document-properties.h @@ -73,7 +73,7 @@ protected: RegisteredUnitMenu _rum_gusn; RegisteredColorPicker _rcp_gui, _rcp_hgui; //--------------------------------------------------------------- - RegisteredCheckButton _rcbsnbb, _rcbsnn; + RegisteredCheckButton _rcbsnbb, _rcbsnn, _rcbsnop, _rcbsnon; RegisteredUnitMenu _rumso; ToleranceSlider _rsu_sno, _rsu_sn, _rsu_gusn; RegisteredRadioButtonPair _rrb_pix; diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index f9a991c24..92a6f76bb 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -56,10 +56,22 @@ ToleranceSlider::~ToleranceSlider() void ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2, const Glib::ustring& tip1, const Glib::ustring& tip2, const Glib::ustring& key, Registry& wr) { + // hbox = label + slider + // + // e.g. + // + // snap distance |-------X---| 37 + + // vbox = checkbutton + // + + // hbox + _vbox = new Gtk::VBox; _hbox = manage (new Gtk::HBox); + Gtk::Label *theLabel1 = manage (new Gtk::Label (label1)); theLabel1->set_use_underline(); + theLabel1->set_alignment(0, 0.5); _hbox->add (*theLabel1); _hscale = manage (new Gtk::HScale (1.0, 51, 1.0)); theLabel1->set_mnemonic_widget (*_hscale); @@ -69,15 +81,17 @@ ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2, _old_val = 10; _hscale->set_value (_old_val); _tt.set_tip (*_hscale, tip1); - _hbox->add (*_hscale); - _vbox->add (*_hbox); + _hbox->add (*_hscale); + Gtk::Label *theLabel2 = manage (new Gtk::Label (label2)); theLabel2->set_use_underline(); _button = manage (new Gtk::CheckButton); _tt.set_tip (*_button, tip2); _button->add (*theLabel2); _button->set_alignment (0.0, 0.5); + _vbox->add (*_button); + _vbox->add (*_hbox); _key = key; _scale_changed_connection = _hscale->signal_value_changed().connect (sigc::mem_fun (*this, &ToleranceSlider::on_scale_changed)); _btn_toggled_connection = _button->signal_toggled().connect (sigc::mem_fun (*this, &ToleranceSlider::on_toggled)); |
