diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-09-15 23:07:21 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-09-15 23:07:21 +0000 |
| commit | 5614df9770b985070122b3c08b45902317c9bd15 (patch) | |
| tree | eca7301deb23560b176f293c0c831ee41180328f /src/ui/widget/spinbutton.cpp | |
| parent | Improved code readability. (diff) | |
| download | inkscape-5614df9770b985070122b3c08b45902317c9bd15.tar.gz inkscape-5614df9770b985070122b3c08b45902317c9bd15.zip | |
Enable unit evaluation in toolbars.
(bzr r12475.1.22)
Diffstat (limited to 'src/ui/widget/spinbutton.cpp')
| -rw-r--r-- | src/ui/widget/spinbutton.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ui/widget/spinbutton.cpp b/src/ui/widget/spinbutton.cpp index c107979a8..2c95e8b5a 100644 --- a/src/ui/widget/spinbutton.cpp +++ b/src/ui/widget/spinbutton.cpp @@ -14,6 +14,7 @@ #include "spinbutton.h" #include "unit-menu.h" +#include "unit-tracker.h" #include "util/expression-evaluator.h" #include "event-context.h" @@ -33,8 +34,13 @@ int SpinButton::on_input(double* newvalue) { try { Inkscape::Util::GimpEevlQuantity result; - if (_unit_menu) { - Unit unit = _unit_menu->getUnit(); + if (_unit_menu || _unit_tracker) { + Unit unit; + if (_unit_menu) { + unit = _unit_menu->getUnit(); + } else { + unit = _unit_tracker->getActiveUnit(); + } result = Inkscape::Util::gimp_eevl_evaluate (get_text().c_str(), &unit); // check if output dimension corresponds to input unit if (result.dimension != (unit.isAbsolute() ? 1 : 0) ) { |
