index 9a9deac9f5f7d0fac880757285c774bccdae7465..726c0ad948f866a3f99a3033c7b4917cb7475b57 100644 (file)
+#include <gtkmm.h>
#include "ui/widget/color-picker.h"
#include "ui/widget/scalar-unit.h"
#include "ui/widget/color-picker.h"
#include "ui/widget/scalar-unit.h"
-#include "ui/widget/button.h"
#include "xml/node-event-vector.h"
#include "helper/units.h"
#include "xml/node-event-vector.h"
#include "helper/units.h"
#include "desktop-handles.h"
#include "desktop.h"
#include "sp-namedview.h"
#include "desktop-handles.h"
#include "desktop.h"
#include "sp-namedview.h"
-#include "helper/action.h"
#include "document-properties.h"
#include "document-properties.h"
static void on_activate_desktop (Inkscape::Application *, SPDesktop* dt, void*);
static void on_deactivate_desktop (Inkscape::Application *, SPDesktop* dt, void*);
static void on_activate_desktop (Inkscape::Application *, SPDesktop* dt, void*);
static void on_deactivate_desktop (Inkscape::Application *, SPDesktop* dt, void*);
-static void fire_fit_canvas_to_selection_or_drawing();
-
static Inkscape::XML::NodeEventVector const _repr_events = {
NULL, /* child_added */
NULL, /* child_removed */
static Inkscape::XML::NodeEventVector const _repr_events = {
NULL, /* child_added */
NULL, /* child_removed */
_page_snap(1, 1),
_prefs_path("dialogs.documentoptions")
{
_page_snap(1, 1),
_prefs_path("dialogs.documentoptions")
{
- hide();
set_resizable (false);
_tt.enable();
get_vbox()->set_spacing (4);
set_resizable (false);
_tt.enable();
get_vbox()->set_spacing (4);
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->addListener (&_repr_events, this);
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->addListener (&_repr_events, this);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(sp_desktop_document(SP_ACTIVE_DESKTOP)->root);
+ root->addListener (&_repr_events, this);
_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
{
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->removeListenerByData (this);
{
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->removeListenerByData (this);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(sp_desktop_document(SP_ACTIVE_DESKTOP)->root);
+ root->removeListenerByData (this);
_doc_replaced_connection.disconnect();
}
_doc_replaced_connection.disconnect();
}
"bordercolor", "borderopacity", _wr);
_rcb_shad.init (_("_Show border shadow"), _("If set, page border shows a shadow on its right and lower side"), "inkscape:showpageshadow", _wr, false);
_rum_deflt.init (_("Default _units:"), "inkscape:document-units", _wr);
"bordercolor", "borderopacity", _wr);
_rcb_shad.init (_("_Show border shadow"), _("If set, page border shows a shadow on its right and lower side"), "inkscape:showpageshadow", _wr, false);
_rum_deflt.init (_("Default _units:"), "inkscape:document-units", _wr);
- Inkscape::UI::Widget::Button* fit_canv = manage(new Inkscape::UI::Widget::Button(_("Fit canvas to selection"),
- _("Fit the canvas to the current selection or fit to the drawing when there is no selection.")));
- fit_canv->signal_clicked().connect(sigc::ptr_fun(fire_fit_canvas_to_selection_or_drawing));
+
Gtk::Label* label_gen = manage (new Gtk::Label);
label_gen->set_markup (_("<b>General</b>"));
Gtk::Label* label_bor = manage (new Gtk::Label);
Gtk::Label* label_gen = manage (new Gtk::Label);
label_gen->set_markup (_("<b>General</b>"));
Gtk::Label* label_bor = manage (new Gtk::Label);
0, 0,
label_for, 0,
0, &_page_sizer,
0, 0,
label_for, 0,
0, &_page_sizer,
- 0, fit_canv,
0, 0,
label_bor, 0,
0, _rcb_canb._button,
0, 0,
label_bor, 0,
0, _rcb_canb._button,
_rcp_hgui.setRgba32 (nv->guidehicolor);
//-----------------------------------------------------------snap
_rcp_hgui.setRgba32 (nv->guidehicolor);
//-----------------------------------------------------------snap
- _rcbsnbo.setActive (nv->snap_object_bbox);
- _rcbsnnob.setActive (nv->snap_object_point);
- _rcbsnop.setActive (nv->snap_object_paths);
- _rcbsnop.setActive (nv->snap_object_nodes);
+ _rcbsnbo.setActive (nv->snap_manager.object.getSnapTo(Inkscape::Snapper::BBOX_POINT));
+ _rcbsnnob.setActive (nv->snap_manager.object.getSnapTo(Inkscape::Snapper::SNAP_POINT));
+ _rcbsnop.setActive (nv->snap_manager.object.getSnapToPaths());
+ _rcbsnop.setActive (nv->snap_manager.object.getSnapToNodes());
_rsu_sno.setValue (nv->objecttolerance, nv->has_abs_tolerance);
_rsu_sno.setValue (nv->objecttolerance, nv->has_abs_tolerance);
- _rcbsnbb.setActive (nv->snap_grid_bbox);
- _rcbsnnod.setActive (nv->snap_grid_point);
+ _rcbsnbb.setActive (nv->snap_manager.grid.getSnapTo(Inkscape::Snapper::BBOX_POINT));
+ _rcbsnnod.setActive (nv->snap_manager.grid.getSnapTo(Inkscape::Snapper::SNAP_POINT));
_rsu_sn.setValue (nv->gridtolerance, nv->has_abs_tolerance);
_rsu_sn.setValue (nv->gridtolerance, nv->has_abs_tolerance);
- _rcb_snpgui.setActive (nv->snap_guide_bbox);
- _rcb_snbgui.setActive (nv->snap_guide_point);
+ _rcb_snpgui.setActive (nv->snap_manager.guide.getSnapTo(Inkscape::Snapper::BBOX_POINT));
+ _rcb_snbgui.setActive (nv->snap_manager.guide.getSnapTo(Inkscape::Snapper::SNAP_POINT));
_rsu_gusn.setValue (nv->guidetolerance, nv->has_abs_tolerance);
// _rrb_pix.setValue (true);
_rsu_gusn.setValue (nv->guidetolerance, nv->has_abs_tolerance);
// _rrb_pix.setValue (true);
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->addListener (&_repr_events, _instance);
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->addListener (&_repr_events, _instance);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(sp_desktop_document(SP_ACTIVE_DESKTOP)->root);
+ root->addListener (&_repr_events, _instance);
_instance->_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
_instance->update();
}
_instance->_doc_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced (sigc::ptr_fun (on_doc_replaced));
_instance->update();
}
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->removeListenerByData (_instance);
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
repr->removeListenerByData (_instance);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(sp_desktop_document(SP_ACTIVE_DESKTOP)->root);
+ root->removeListenerByData (_instance);
_instance->_doc_replaced_connection.disconnect();
}
_instance->_doc_replaced_connection.disconnect();
}
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(dt));
repr->addListener (&_repr_events, _instance);
Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(dt));
repr->addListener (&_repr_events, _instance);
+ Inkscape::XML::Node *root = SP_OBJECT_REPR(doc->root);
+ root->addListener (&_repr_events, _instance);
_instance->update();
}
_instance->update();
}
-static void
-fire_fit_canvas_to_selection_or_drawing() {
- SPDesktop *dt = SP_ACTIVE_DESKTOP;
- if (!dt) return;
- Verb *verb = Verb::get( SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING );
- if (verb) {
- SPAction *action = verb->get_action(dt);
- if (action) {
- sp_action_perform(action, NULL);
- }
- }
-}
-
} // namespace Dialog
} // namespace UI
} // namespace Dialog
} // namespace UI