summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Scholzen 'DASPRiD <mail@dasprids.de>2015-05-20 13:35:51 +0000
committerBen Scholzen 'DASPRiD <mail@dasprids.de>2015-05-20 13:35:51 +0000
commit2645ecd8d21e66346238d3f75a844499c94ca328 (patch)
tree7305c2739d87f9af9f42d9fcd2becff8582ce1b5 /src
parentFont-variants widget: Enable 'Apply' button. Add more tooltips. (diff)
downloadinkscape-2645ecd8d21e66346238d3f75a844499c94ca328.tar.gz
inkscape-2645ecd8d21e66346238d3f75a844499c94ca328.zip
Fix locale number handling on powerstroke dialog
(bzr r14163.1.1)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/lpe-powerstroke-properties.cpp19
-rw-r--r--src/ui/dialog/lpe-powerstroke-properties.h14
2 files changed, 14 insertions, 19 deletions
diff --git a/src/ui/dialog/lpe-powerstroke-properties.cpp b/src/ui/dialog/lpe-powerstroke-properties.cpp
index 0cf3e9706..aa2b3cb72 100644
--- a/src/ui/dialog/lpe-powerstroke-properties.cpp
+++ b/src/ui/dialog/lpe-powerstroke-properties.cpp
@@ -52,10 +52,16 @@ PowerstrokePropertiesDialog::PowerstrokePropertiesDialog()
// Layer name widgets
_powerstroke_position_entry.set_activates_default(true);
+ _powerstroke_position_entry.set_digits(4);
+ _powerstroke_position_entry.set_increments(1,1);
+ _powerstroke_position_entry.set_range(-999999999999999999., 999999999999999999.);
_powerstroke_position_label.set_label(_("Position:"));
_powerstroke_position_label.set_alignment(1.0, 0.5);
_powerstroke_width_entry.set_activates_default(true);
+ _powerstroke_width_entry.set_digits(4);
+ _powerstroke_width_entry.set_increments(1,1);
+ _powerstroke_width_entry.set_range(-999999999999999999., 999999999999999999.);
_powerstroke_width_label.set_label(_("Width:"));
_powerstroke_width_label.set_alignment(1.0, 0.5);
@@ -126,12 +132,9 @@ void PowerstrokePropertiesDialog::showDialog(SPDesktop *desktop, Geom::Point kno
void
PowerstrokePropertiesDialog::_apply()
{
- std::istringstream i_pos(_powerstroke_position_entry.get_text());
- std::istringstream i_width(_powerstroke_width_entry.get_text());
- double d_pos, d_width;
- if ((i_pos >> d_pos) && i_width >> d_width) {
- _knotpoint->knot_set_offset(Geom::Point(d_pos, d_width));
- }
+ double d_pos = _powerstroke_position_entry.get_value();
+ double d_width = _powerstroke_width_entry.get_value();
+ _knotpoint->knot_set_offset(Geom::Point(d_pos, d_width));
_close();
}
@@ -171,8 +174,8 @@ void PowerstrokePropertiesDialog::_handleButtonEvent(GdkEventButton* event)
void PowerstrokePropertiesDialog::_setKnotPoint(Geom::Point knotpoint)
{
- _powerstroke_position_entry.set_text(boost::lexical_cast<std::string>(knotpoint.x()));
- _powerstroke_width_entry.set_text(boost::lexical_cast<std::string>(knotpoint.y()));
+ _powerstroke_position_entry.set_value(knotpoint.x());
+ _powerstroke_width_entry.set_value(knotpoint.y());
}
void PowerstrokePropertiesDialog::_setPt(const Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity *pt)
diff --git a/src/ui/dialog/lpe-powerstroke-properties.h b/src/ui/dialog/lpe-powerstroke-properties.h
index c53eac0d9..1e4c1df5b 100644
--- a/src/ui/dialog/lpe-powerstroke-properties.h
+++ b/src/ui/dialog/lpe-powerstroke-properties.h
@@ -13,15 +13,7 @@
#define INKSCAPE_DIALOG_POWERSTROKE_PROPERTIES_H
#include <2geom/point.h>
-#include <gtkmm/dialog.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/label.h>
-#include <gtkmm/table.h>
-#include <gtkmm/combobox.h>
-#include <gtkmm/liststore.h>
-#include <gtkmm/treeview.h>
-#include <gtkmm/treestore.h>
-#include <gtkmm/scrolledwindow.h>
+#include <gtkmm.h>
#include "live_effects/parameter/powerstrokepointarray.h"
class SPDesktop;
@@ -45,9 +37,9 @@ protected:
Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity *_knotpoint;
Gtk::Label _powerstroke_position_label;
- Gtk::Entry _powerstroke_position_entry;
+ Gtk::SpinButton _powerstroke_position_entry;
Gtk::Label _powerstroke_width_label;
- Gtk::Entry _powerstroke_width_entry;
+ Gtk::SpinButton _powerstroke_width_entry;
Gtk::Table _layout_table;
bool _position_visible;