Refined zoom step
authorKlaus Ethgen <Klaus@Ethgen.de>
Thu, 19 May 2016 16:26:05 +0000 (17:26 +0100)
committerKlaus Ethgen <Klaus@Ethgen.de>
Thu, 19 May 2016 16:26:05 +0000 (17:26 +0100)
I would give the credentials to the orignal author but he is only known
as "unqwist".

Closes #359.

src/image.c
src/misc.c
src/options.h
src/preferences.c

index 603da25..6f78dc9 100644 (file)
@@ -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);
 }
index 6f244ec..cddecb0 100644 (file)
@@ -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)
index ad0468f..eaa4fd1 100644 (file)
@@ -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;
index 7f27554..3167ae5 100644 (file)
@@ -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);