diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-07-19 19:56:24 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-07-19 19:56:24 +0000 |
| commit | 4d00e731811f7c795b80b49b408eb76a9852b9f0 (patch) | |
| tree | 913612bd133139e963a0a5a61c8a2e3b4a1cdb1e /src | |
| parent | Ported "ui/widget/selected-style.*". (diff) | |
| download | inkscape-4d00e731811f7c795b80b49b408eb76a9852b9f0.tar.gz inkscape-4d00e731811f7c795b80b49b408eb76a9852b9f0.zip | |
Ported "ui/widget/style-swatch.*".
(bzr r12380.1.40)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/widget/style-swatch.cpp | 6 | ||||
| -rw-r--r-- | src/ui/widget/style-swatch.h | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp index aedab3fa5..682457bed 100644 --- a/src/ui/widget/style-swatch.cpp +++ b/src/ui/widget/style-swatch.cpp @@ -26,7 +26,7 @@ #include "xml/repr.h" #include "xml/sp-css-attr.h" #include "widgets/widget-sizes.h" -#include "helper/units.h" +#include "util/units.h" #include "helper/action.h" #include "helper/action-context.h" #include "preferences.h" @@ -333,7 +333,7 @@ void StyleSwatch::setStyle(SPStyle *query) if (has_stroke) { double w; if (_sw_unit) { - w = sp_pixels_get_units(query->stroke_width.computed, *_sw_unit); + w = Inkscape::Util::Quantity::convert(query->stroke_width.computed, "px", *_sw_unit); } else { w = query->stroke_width.computed; } @@ -346,7 +346,7 @@ void StyleSwatch::setStyle(SPStyle *query) { gchar *str = g_strdup_printf(_("Stroke width: %.5g%s"), w, - _sw_unit? sp_unit_get_abbreviation(_sw_unit) : "px"); + _sw_unit? _sw_unit->abbr.c_str() : "px"); _stroke_width_place.set_tooltip_text(str); g_free (str); } diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h index 6bdb5e248..6da58a2dd 100644 --- a/src/ui/widget/style-swatch.h +++ b/src/ui/widget/style-swatch.h @@ -30,7 +30,6 @@ #include "button.h" #include "preferences.h" -struct SPUnit; struct SPStyle; class SPCSSAttr; @@ -43,6 +42,11 @@ class Table; } namespace Inkscape { + +namespace Util { + class Unit; +} + namespace UI { namespace Widget { @@ -93,7 +97,7 @@ private: Gtk::EventBox _stroke_width_place; Gtk::Label _stroke_width; - SPUnit *_sw_unit; + Inkscape::Util::Unit *_sw_unit; friend class ToolObserver; }; |
