diff options
| author | John Bintz <me@johnbintz.com> | 2007-11-01 02:42:00 +0000 |
|---|---|---|
| committer | johncoswell <johncoswell@users.sourceforge.net> | 2007-11-01 02:42:00 +0000 |
| commit | 0db29ed689ae9b387c70744ed8c4693b5f3dda11 (patch) | |
| tree | db7c86e73ef244b3bb74e7c22fd9ab299b00c0c2 /src/widgets/toolbox.cpp | |
| parent | Diffuse Lighting Filter: (diff) | |
| download | inkscape-0db29ed689ae9b387c70744ed8c4693b5f3dda11.tar.gz inkscape-0db29ed689ae9b387c70744ed8c4693b5f3dda11.zip | |
store paint bucket offset units in preferences to work around toolbar initialization issue
(bzr r4000)
Diffstat (limited to 'src/widgets/toolbox.cpp')
| -rw-r--r-- | src/widgets/toolbox.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 803041c6e..94e43a00b 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -4962,11 +4962,12 @@ static void paintbucket_autogap_changed(EgeSelectOneAction* act, GObject *tbl) static void paintbucket_offset_changed(GtkAdjustment *adj, GObject *tbl) { - UnitTracker* tracker = reinterpret_cast<UnitTracker*>(g_object_get_data( tbl, "tracker" )); + UnitTracker* tracker = static_cast<UnitTracker*>(g_object_get_data( tbl, "tracker" )); SPUnit const *unit = tracker->getActiveUnit(); - prefs_set_double_attribute("tools.paintbucket", "offset", (gdouble)sp_units_get_pixels(adj->value, *unit)); + + prefs_set_string_attribute("tools.paintbucket", "offsetunits", sp_unit_get_abbreviation(unit)); } static void paintbucket_defaults(GtkWidget *, GObject *dataKludge) @@ -5036,7 +5037,7 @@ static void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* main // Create the units menu. UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + tracker->setActiveUnit(sp_unit_get_by_abbreviation(prefs_get_string_attribute("tools.paintbucket", "offsetunits"))); g_object_set_data( holder, "tracker", tracker ); { GtkAction* act = tracker->createAction( "PaintbucketUnitsAction", _("Units"), ("") ); |
