summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-11-03 23:42:23 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-11-03 23:42:23 +0000
commit48ac54f0234671b23afeaad33af6168037ef552c (patch)
tree3a937530c745c958f8da1e788a8dfe94cff847d4 /src/ui
parentUpdate to trunk (diff)
parentRemove antiquated Perl extensions and modules, which were mostly useless. (diff)
downloadinkscape-48ac54f0234671b23afeaad33af6168037ef552c.tar.gz
inkscape-48ac54f0234671b23afeaad33af6168037ef552c.zip
Update to trunk
(bzr r12588.1.25)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/document-properties.cpp30
-rw-r--r--src/ui/dialog/export.cpp41
-rw-r--r--src/ui/dialog/export.h9
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp2
4 files changed, 52 insertions, 30 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 79fb953ac..32f23d55f 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -1677,11 +1677,31 @@ void DocumentProperties::onDocUnitChange()
}
// Scale and translate objects
- gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit);
- ShapeEditor::blockSetItem(true);
- doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px")));
- ShapeEditor::blockSetItem(false);
-
+ // set transform options to scale all things with the transform, so all things scale properly after the viewbox change.
+ /// \todo this "low-level" code of changing viewbox/unit should be moved somewhere else
+
+ // save prefs
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ bool transform_stroke = prefs->getBool("/options/transform/stroke", true);
+ bool transform_rectcorners = prefs->getBool("/options/transform/rectcorners", true);
+ bool transform_pattern = prefs->getBool("/options/transform/pattern", true);
+ bool transform_gradient = prefs->getBool("/options/transform/gradient", true);
+
+ prefs->setBool("/options/transform/stroke", true);
+ prefs->setBool("/options/transform/rectcorners", true);
+ prefs->setBool("/options/transform/pattern", true);
+ prefs->setBool("/options/transform/gradient", true);
+ {
+ ShapeEditor::blockSetItem(true);
+ gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit);
+ doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px")));
+ ShapeEditor::blockSetItem(false);
+ }
+ prefs->setBool("/options/transform/stroke", transform_stroke);
+ prefs->setBool("/options/transform/rectcorners", transform_rectcorners);
+ prefs->setBool("/options/transform/pattern", transform_pattern);
+ prefs->setBool("/options/transform/gradient", transform_gradient);
+
doc->setModifiedSinceSave();
DocumentUndo::done(doc, SP_VERB_NONE, _("Changed document unit"));
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index f1f7cf6c1..8ea1a09fa 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -164,6 +164,7 @@ Export::Export (void) :
size_box(false, 3),
file_box(false, 3),
unitbox(false, 0),
+ unit_selector(),
units_label(_("Units:")),
filename_box(false, 5),
browse_label(_("_Export As..."), 1),
@@ -199,14 +200,14 @@ Export::Export (void) :
/* Units box */
/* gets added to the vbox later, but the unit selector is needed
earlier than that */
- unit_selector = new Inkscape::UI::Widget::UnitMenu();
- unit_selector->setUnitType(Inkscape::Util::UNIT_TYPE_LINEAR);
+ unit_selector.setUnitType(Inkscape::Util::UNIT_TYPE_LINEAR);
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- if (desktop)
- unit_selector->setUnit(sp_desktop_namedview(desktop)->doc_units->abbr);
- unitChangedConn = unit_selector->signal_changed().connect(sigc::mem_fun(*this, &Export::onUnitChanged));
- unitbox.pack_end(*unit_selector, false, false, 0);
+ if (desktop) {
+ unit_selector.setUnit(sp_desktop_namedview(desktop)->doc_units->abbr);
+ }
+ unitChangedConn = unit_selector.signal_changed().connect(sigc::mem_fun(*this, &Export::onUnitChanged));
+ unitbox.pack_end(unit_selector, false, false, 0);
unitbox.pack_end(units_label, false, false, 3);
for (int i = 0; i < SELECTION_NUMBER_OF; i++) {
@@ -230,28 +231,28 @@ Export::Export (void) :
t->set_col_spacings (4);
#endif
- x0_adj = createSpinbutton ( "x0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, ((Gtk::Widget*) unit_selector)->gobj(),
+ x0_adj = createSpinbutton ( "x0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0,
t, 0, 0, _("_x0:"), "", EXPORT_COORD_PRECISION, 1,
&Export::onAreaX0Change);
- x1_adj = createSpinbutton ( "x1", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, ((Gtk::Widget*) unit_selector)->gobj(),
+ x1_adj = createSpinbutton ( "x1", 0.0, -1000000.0, 1000000.0, 0.1, 1.0,
t, 0, 1, _("x_1:"), "", EXPORT_COORD_PRECISION, 1,
&Export::onAreaX1Change);
width_adj = createSpinbutton ( "width", 0.0, 0.0, PNG_UINT_31_MAX, 0.1, 1.0,
- ((Gtk::Widget*) unit_selector)->gobj(), t, 0, 2, _("Wid_th:"), "", EXPORT_COORD_PRECISION, 1,
+ t, 0, 2, _("Wid_th:"), "", EXPORT_COORD_PRECISION, 1,
&Export::onAreaWidthChange);
- y0_adj = createSpinbutton ( "y0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, ((Gtk::Widget*) unit_selector)->gobj(),
+ y0_adj = createSpinbutton ( "y0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0,
t, 2, 0, _("_y0:"), "", EXPORT_COORD_PRECISION, 1,
&Export::onAreaY0Change);
- y1_adj = createSpinbutton ( "y1", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, ((Gtk::Widget*) unit_selector)->gobj(),
+ y1_adj = createSpinbutton ( "y1", 0.0, -1000000.0, 1000000.0, 0.1, 1.0,
t, 2, 1, _("y_1:"), "", EXPORT_COORD_PRECISION, 1,
&Export::onAreaY1Change);
height_adj = createSpinbutton ( "height", 0.0, 0.0, PNG_UINT_31_MAX, 0.1, 1.0,
- ((Gtk::Widget*) unit_selector)->gobj(), t, 2, 2, _("Hei_ght:"), "", EXPORT_COORD_PRECISION, 1,
+ t, 2, 2, _("Hei_ght:"), "", EXPORT_COORD_PRECISION, 1,
&Export::onAreaHeightChange);
area_box.pack_start(togglebox, false, false, 3);
@@ -283,18 +284,18 @@ Export::Export (void) :
size_box.pack_start(*t);
bmwidth_adj = createSpinbutton ( "bmwidth", 16.0, 1.0, 1000000.0, 1.0, 10.0,
- NULL, t, 0, 0,
+ t, 0, 0,
_("_Width:"), _("pixels at"), 0, 1,
&Export::onBitmapWidthChange);
xdpi_adj = createSpinbutton ( "xdpi",
prefs->getDouble("/dialogs/export/defaultxdpi/value", DPI_BASE),
- 0.01, 100000.0, 0.1, 1.0, NULL, t, 3, 0,
+ 0.01, 100000.0, 0.1, 1.0, t, 3, 0,
"", _("dp_i"), 2, 1,
&Export::onExportXdpiChange);
bmheight_adj = createSpinbutton ( "bmheight", 16.0, 1.0, 1000000.0, 1.0, 10.0,
- NULL, t, 0, 1,
+ t, 0, 1,
_("_Height:"), _("pixels at"), 0, 1,
&Export::onBitmapHeightChange);
@@ -302,7 +303,7 @@ Export::Export (void) :
* There's no way to set ydpi currently, so we use the defaultxdpi value here, too...
*/
ydpi_adj = createSpinbutton ( "ydpi", prefs->getDouble("/dialogs/export/defaultxdpi/value", DPI_BASE),
- 0.01, 100000.0, 0.1, 1.0, NULL, t, 3, 1,
+ 0.01, 100000.0, 0.1, 1.0, t, 3, 1,
"", _("dpi"), 2, 0, NULL );
singleexport_box.pack_start(size_box);
@@ -481,14 +482,14 @@ void Export::set_default_filename () {
#if WITH_GTKMM_3_0
Glib::RefPtr<Gtk::Adjustment> Export::createSpinbutton( gchar const * /*key*/, float val, float min, float max,
- float step, float page, GtkWidget *us,
+ float step, float page,
Gtk::Grid *t, int x, int y,
const Glib::ustring ll, const Glib::ustring lr,
int digits, unsigned int sensitive,
void (Export::*cb)() )
#else
Gtk::Adjustment * Export::createSpinbutton( gchar const * /*key*/, float val, float min, float max,
- float step, float page, GtkWidget *us,
+ float step, float page,
Gtk::Table *t, int x, int y,
const Glib::ustring ll, const Glib::ustring lr,
int digits, unsigned int sensitive,
@@ -1884,7 +1885,7 @@ void Export::setValuePx(Glib::RefPtr<Gtk::Adjustment>& adj, double val)
void Export::setValuePx( Gtk::Adjustment *adj, double val)
#endif
{
- Unit const *unit = unit_selector->getUnit();
+ Unit const *unit = unit_selector.getUnit();
setValue(adj, Inkscape::Util::Quantity::convert(val, "px", unit));
@@ -1934,7 +1935,7 @@ float Export::getValuePx( Gtk::Adjustment *adj )
#endif
{
float value = getValue( adj);
- Unit const *unit = unit_selector->getUnit();
+ Unit const *unit = unit_selector.getUnit();
return Inkscape::Util::Quantity::convert(value, unit, "px");
} // end of sp_export_value_get_px()
diff --git a/src/ui/dialog/export.h b/src/ui/dialog/export.h
index f324f5dc5..79e597414 100644
--- a/src/ui/dialog/export.h
+++ b/src/ui/dialog/export.h
@@ -108,7 +108,6 @@ private:
* @param max Maximum value for the spin button
* @param step The step size for the spin button
* @param page Size of the page increment
- * @param us Unit selector that effects this spin button
* @param t Table to put the spin button in
* @param x X location in the table \c t to start with
* @param y Y location in the table \c t to start with
@@ -117,17 +116,19 @@ private:
* @param digits Number of digits to display after the decimal
* @param sensitive Whether the spin button is sensitive or not
* @param cb Callback for when this spin button is changed (optional)
+ *
+ * No unit_selector is stored in the created spinbutton, relies on external unit management
*/
#if WITH_GTKMM_3_0
Glib::RefPtr<Gtk::Adjustment> createSpinbutton( gchar const *key, float val, float min, float max,
- float step, float page, GtkWidget *us,
+ float step, float page,
Gtk::Grid *t, int x, int y,
const Glib::ustring ll, const Glib::ustring lr,
int digits, unsigned int sensitive,
void (Export::*cb)() );
#else
Gtk::Adjustment * createSpinbutton( gchar const *key, float val, float min, float max,
- float step, float page, GtkWidget *us,
+ float step, float page,
Gtk::Table *t, int x, int y,
const Glib::ustring ll, const Glib::ustring lr,
int digits, unsigned int sensitive,
@@ -335,7 +336,7 @@ private:
/* Unit selector widgets */
Gtk::HBox unitbox;
- Inkscape::UI::Widget::UnitMenu *unit_selector;
+ Inkscape::UI::Widget::UnitMenu unit_selector;
Gtk::Label units_label;
/* Filename widgets */
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 4ce2eafd1..38e05a1c7 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1307,7 +1307,7 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa
}
}
-void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& path) {
+void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& /*path*/) {
for(Gtk::TreeModel::iterator i = _model->children().begin(); i != _model->children().end(); ++i) {
SPObject* object = (*i)[_columns.filter];
if(object && object->getRepr())