From fdb897947621a286ae05cd990e8663bb6c3dd907 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 23 Oct 2016 22:24:00 +0200 Subject: Fix for widget value of rotate (bzr r15142.1.24) --- src/widgets/desktop-widget.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/widgets/desktop-widget.cpp') diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 477414342..94abd23a9 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -66,6 +66,7 @@ #include #include #include +#include #if defined (SOLARIS) && (SOLARIS == 8) #include "round.h" @@ -1890,7 +1891,11 @@ sp_dtw_rotation_input (GtkSpinButton *spin, gdouble *new_val, gpointer /*data*/) const gchar *b = gtk_entry_get_text (GTK_ENTRY (spin)); gdouble new_typed = atof (b); - *new_val = new_typed; + if (new_scrolled == new_typed) { // the new value is set by scrolling + *new_val = new_scrolled; + } else { // the new value is typed in + *new_val = new_typed; + } return TRUE; } @@ -1900,8 +1905,10 @@ sp_dtw_rotation_output (GtkSpinButton *spin, gpointer /*data*/) { gchar b[64]; double val = gtk_spin_button_get_value (spin); - g_snprintf (b, 64, "%3.2fº", val); - gtk_entry_set_text (GTK_ENTRY (spin), b); + std::ostringstream s; + s.imbue(std::locale(""));; + s << std::fixed << std::setprecision(2) << val << "º"; + gtk_entry_set_text (GTK_ENTRY (spin), s.str().c_str()); return TRUE; } -- cgit v1.2.3