From: Klaus Ethgen Date: Thu, 19 May 2016 16:26:05 +0000 (+0100) Subject: Refined zoom step X-Git-Tag: v1.3~12 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=f282fd9f308b201e220e4827c04a5d8358ee8305 Refined zoom step I would give the credentials to the orignal author but he is only known as "unqwist". Closes #359. --- diff --git a/src/image.c b/src/image.c index 603da253..6f78dc9e 100644 --- a/src/image.c +++ b/src/image.c @@ -1404,8 +1404,8 @@ gchar *image_zoom_get_as_text(ImageWindow *imd) approx = "~"; } - if (rint(l) != l) pl = 1; - if (rint(r) != r) pr = 1; + if (rint(l) != l) pl = 2; + if (rint(r) != r) pr = 2; return g_strdup_printf("%.*f :%s%.*f", pl, l, approx, pr, r); } diff --git a/src/misc.c b/src/misc.c index 6f244ece..cddecb05 100644 --- a/src/misc.c +++ b/src/misc.c @@ -14,7 +14,7 @@ gdouble get_zoom_increment(void) { - return ((options->image.zoom_increment != 0) ? (gdouble)options->image.zoom_increment / 10.0 : 1.0); + return ((options->image.zoom_increment != 0) ? (gdouble)options->image.zoom_increment / 100.0 : 1.0); } gchar *utf8_validate_or_convert(const gchar *text) diff --git a/src/options.h b/src/options.h index ad0468fb..eaa4fd18 100644 --- a/src/options.h +++ b/src/options.h @@ -67,7 +67,7 @@ struct _ConfOptions gboolean zoom_2pass; gboolean zoom_to_fit_allow_expand; guint zoom_quality; - gint zoom_increment; /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */ + gint zoom_increment; /* 100 is 1.0, 5 is 0.05, 200 is 2.0, etc. */ gboolean use_clutter_renderer; gboolean use_custom_border_color_in_fullscreen; diff --git a/src/preferences.c b/src/preferences.c index 7f27554d..3167ae57 100644 --- a/src/preferences.c +++ b/src/preferences.c @@ -138,7 +138,7 @@ static void scroll_reset_cb(GtkWidget *widget, gpointer data) static void zoom_increment_cb(GtkWidget *spin, gpointer data) { - c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01); + c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 100.0 + 0.01); } static void slideshow_delay_cb(GtkWidget *spin, gpointer data) @@ -1400,7 +1400,7 @@ static void config_tab_image(GtkWidget *notebook) c_options->image.zoom_increment = options->image.zoom_increment; spin = pref_spin_new(group, _("Zoom increment:"), NULL, - 0.1, 4.0, 0.1, 1, (gdouble)options->image.zoom_increment / 10.0, + 0.01, 4.0, 0.01, 2, (gdouble)options->image.zoom_increment / 100.0, G_CALLBACK(zoom_increment_cb), NULL); gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS);