summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a348ec0)
raw | patch | inline | side by side (parent: a348ec0)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 19 Nov 2007 18:20:47 +0000 (18:20 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 19 Nov 2007 18:20:47 +0000 (18:20 +0000) |
src/widgets/desktop-widget.cpp | patch | blob | history |
index 79e6fd33cba777abe8f1fce55427e096582e06f3..51355b3e516af91c7e1557ff34fe7837840d5926 100644 (file)
static gdouble
sp_dtw_zoom_value_to_display (gdouble value)
{
- return floor (pow (2, value) * 100.0 + 0.5);
+ return floor (10 * (pow (2, value) * 100.0 + 0.05)) / 10;
}
static gdouble
sp_dtw_zoom_output (GtkSpinButton *spin, gpointer data)
{
gchar b[64];
- g_snprintf (b, 64, "%4.0f%%", sp_dtw_zoom_value_to_display (gtk_spin_button_get_value (spin)));
+ double val = sp_dtw_zoom_value_to_display (gtk_spin_button_get_value (spin));
+ if (val < 10) {
+ g_snprintf (b, 64, "%4.1f%%", val);
+ } else {
+ g_snprintf (b, 64, "%4.0f%%", val);
+ }
gtk_entry_set_text (GTK_ENTRY (spin), b);
return TRUE;
}