summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-07-17 04:15:06 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-07-17 04:15:06 +0000
commita2b755108f544e938705a364d2573b049e21f26f (patch)
tree6377f03e8d77a1de4764dd11eaebd5d9f6c538e2 /src
parentRemoved unused unit includes. (diff)
downloadinkscape-a2b755108f544e938705a364d2573b049e21f26f.tar.gz
inkscape-a2b755108f544e938705a364d2573b049e21f26f.zip
Ported "widgets/text-toolbar.cpp" and "widgets/paintbucket.cpp"
(bzr r12380.1.11)
Diffstat (limited to 'src')
-rw-r--r--src/widgets/paintbucket-toolbar.cpp17
-rw-r--r--src/widgets/text-toolbar.cpp9
2 files changed, 12 insertions, 14 deletions
diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp
index 73815b86d..2c782da70 100644
--- a/src/widgets/paintbucket-toolbar.cpp
+++ b/src/widgets/paintbucket-toolbar.cpp
@@ -54,9 +54,8 @@
#include "../xml/repr.h"
#include "ui/uxmanager.h"
#include "../ui/icon-names.h"
-#include "../helper/unit-menu.h"
-#include "../helper/units.h"
-#include "../helper/unit-tracker.h"
+#include "util/units.h"
+#include "ui/widget/unit-tracker.h"
#include "../pen-context.h"
#include "../sp-namedview.h"
#include "../flood-context.h"
@@ -64,7 +63,7 @@
#include <gtk/gtk.h>
-using Inkscape::UnitTracker;
+using Inkscape::UI::Widget::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
@@ -97,13 +96,13 @@ static void paintbucket_autogap_changed(EgeSelectOneAction* act, GObject * /*tbl
static void paintbucket_offset_changed(GtkAdjustment *adj, GObject *tbl)
{
UnitTracker* tracker = static_cast<UnitTracker*>(g_object_get_data( tbl, "tracker" ));
- SPUnit const *unit = tracker->getActiveUnit();
+ Unit const unit = tracker->getActiveUnit();
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
// Don't adjust the offset value because we're saving the
// unit and it'll be correctly handled on load.
prefs->setDouble("/tools/paintbucket/offset", (gdouble)gtk_adjustment_get_value(adj));
- prefs->setString("/tools/paintbucket/offsetunits", sp_unit_get_abbreviation(unit));
+ prefs->setString("/tools/paintbucket/offsetunits", unit.abbr);
}
static void paintbucket_defaults(GtkWidget *, GObject *tbl)
@@ -175,10 +174,12 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions
}
// Create the units menu.
- UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE );
+ UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR);
+ Inkscape::Util::UnitTable unit_table;
Glib::ustring stored_unit = prefs->getString("/tools/paintbucket/offsetunits");
if (!stored_unit.empty()) {
- tracker->setActiveUnit(sp_unit_get_by_abbreviation(stored_unit.data()));
+ Unit u = unit_table.getUnit(stored_unit);
+ tracker->setActiveUnit(&u);
}
g_object_set_data( holder, "tracker", tracker );
{
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp
index 144a2a3e8..4dd44bb8d 100644
--- a/src/widgets/text-toolbar.cpp
+++ b/src/widgets/text-toolbar.cpp
@@ -56,9 +56,6 @@
#include "../xml/repr.h"
#include "ui/uxmanager.h"
#include "../ui/icon-names.h"
-#include "../helper/unit-menu.h"
-#include "../helper/units.h"
-#include "../helper/unit-tracker.h"
#include "../pen-context.h"
#include "../sp-namedview.h"
#include "../svg/css-ostringstream.h"
@@ -72,7 +69,6 @@
#include "widgets/font-selector.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
@@ -1218,9 +1214,10 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1);
// Is this used?
- UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE );
+ /*UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE );
//tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units );
- g_object_set_data( holder, "tracker", tracker );
+ tracker->setActiveUnit(&sp_unit_get_by_id(SP_UNIT_PX));
+ g_object_set_data( holder, "tracker", tracker );*/
/* Font family */
{