From e4f94a14c8e209d086395d23501bc39f321fb81f Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 18 Nov 2007 14:26:08 +0000 Subject: [PATCH] Fix bug [ 1685684 ] Document Properties: Grid number fields round too broadly --- src/display/canvas-grid.cpp | 13 +++++++++++++ src/ui/dialog/document-properties.cpp | 3 +-- src/ui/widget/registered-widget.cpp | 1 + src/ui/widget/scalar.cpp | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index b4568d2e4..b58a53297 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -359,15 +359,28 @@ CanvasXYGrid::CanvasXYGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPD table.set_spacings(2); vbox.pack_start(table, false, false, 0); + Inkscape::UI::Widget::ScalarUnit * sutemp; _rumg.init (_("Grid _units:"), "units", _wr, repr, doc); _rsu_ox.init (_("_Origin X:"), _("X coordinate of grid origin"), "originx", _rumg, _wr, repr, doc); + sutemp = _rsu_ox.getSU(); + sutemp->setDigits(4); + sutemp->setIncrements(0.1, 1.0); _rsu_oy.init (_("O_rigin Y:"), _("Y coordinate of grid origin"), "originy", _rumg, _wr, repr, doc); + sutemp = _rsu_oy.getSU(); + sutemp->setDigits(4); + sutemp->setIncrements(0.1, 1.0); _rsu_sx.init (_("Spacing _X:"), _("Distance between vertical grid lines"), "spacingx", _rumg, _wr, repr, doc); + sutemp = _rsu_sx.getSU(); + sutemp->setDigits(4); + sutemp->setIncrements(0.1, 1.0); _rsu_sy.init (_("Spacing _Y:"), _("Distance between horizontal grid lines"), "spacingy", _rumg, _wr, repr, doc); + sutemp = _rsu_sy.getSU(); + sutemp->setDigits(4); + sutemp->setIncrements(0.1, 1.0); _rcp_gcol.init (_("Grid line _color:"), _("Grid line color"), _("Color of grid lines"), "color", "opacity", _wr, repr, doc); _rcp_gmcol.init (_("Ma_jor grid line color:"), _("Major grid line color"), diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 88e9f2bf2..7e71a0e3e 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -463,8 +463,7 @@ DocumentProperties::build_gridspage() label_def, 0 }; attach_all(_page_grids.table(), widget_array, G_N_ELEMENTS(widget_array)); - _page_grids.table().attach(_grids_notebook, 0, 3, 4, 5, - Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0); + _page_grids.table().attach(_grids_notebook, 0, 3, 4, 5, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0); } diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 55f81cfaf..804a403f6 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -410,6 +410,7 @@ RegisteredSuffixedInteger::init (const Glib::ustring& label, const Glib::ustring _label->set_alignment (1.0, 0.5); _label->set_use_underline(); _sb = new Gtk::SpinButton (_adj, 1.0, 0); + _sb->set_numeric(); _label->set_mnemonic_widget (*_sb); _suffix = new Gtk::Label (suffix); _hbox.pack_start (*_sb, true, true, 0); diff --git a/src/ui/widget/scalar.cpp b/src/ui/widget/scalar.cpp index ae90e4a0f..743c879f0 100644 --- a/src/ui/widget/scalar.cpp +++ b/src/ui/widget/scalar.cpp @@ -40,6 +40,7 @@ Scalar::Scalar(Glib::ustring const &label, Glib::ustring const &tooltip, : Labelled(label, tooltip, new Gtk::SpinButton(), suffix, icon, mnemonic), setProgrammatically(false) { + static_cast(_widget)->set_numeric(); } /** @@ -61,6 +62,7 @@ Scalar::Scalar(Glib::ustring const &label, Glib::ustring const &tooltip, : Labelled(label, tooltip, new Gtk::SpinButton(0.0, digits), suffix, icon, mnemonic), setProgrammatically(false) { + static_cast(_widget)->set_numeric(); } /** @@ -84,6 +86,7 @@ Scalar::Scalar(Glib::ustring const &label, Glib::ustring const &tooltip, : Labelled(label, tooltip, new Gtk::SpinButton(adjust, 0.0, digits), suffix, icon, mnemonic), setProgrammatically(false) { + static_cast(_widget)->set_numeric(); } /** Fetches the precision of the spin buton */ -- 2.30.2