Mercurial > hg > forks > geeqie
diff src/preferences.c @ 2474:f591509cb3d3
Fix #123: Limit image expansion in Fit To Window
https://github.com/BestImageViewer/geeqie/issues/123
Additional option in Preferences/Image to limit the expansion of an
image in Fit To Window mode. Stops small images being over-magnified.
author | Colin Clark <colin.clark@cclark.uk> |
---|---|
date | Wed, 03 May 2017 11:30:12 +0100 |
parents | e4c44411a090 |
children | 9b050f7e7b6c |
line wrap: on
line diff
--- a/src/preferences.c Tue May 02 09:54:59 2017 +0100 +++ b/src/preferences.c Wed May 03 11:30:12 2017 +0100 @@ -236,6 +236,7 @@ options->image.max_window_size = c_options->image.max_window_size; options->image.limit_autofit_size = c_options->image.limit_autofit_size; options->image.max_autofit_size = c_options->image.max_autofit_size; + options->image.max_enlargement_size = c_options->image.max_enlargement_size; options->image.use_clutter_renderer = c_options->image.use_clutter_renderer; options->progressive_key_scrolling = c_options->progressive_key_scrolling; options->keyboard_scroll_step = c_options->keyboard_scroll_step; @@ -1478,6 +1479,7 @@ GtkWidget *group; GtkWidget *button; GtkWidget *ct_button; + GtkWidget *enlargement_button; GtkWidget *table; GtkWidget *spin; @@ -1496,11 +1498,16 @@ pref_checkbox_new_int(group, _("Two pass rendering (apply HQ zoom and color correction in second pass)"), options->image.zoom_2pass, &c_options->image.zoom_2pass); - pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), + hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); + enlargement_button = pref_checkbox_new_int(hbox, _("Allow enlargement of image for zoom to fit (max. size in %)"), options->image.zoom_to_fit_allow_expand, &c_options->image.zoom_to_fit_allow_expand); + spin = pref_spin_new_int(hbox, NULL, NULL, + 100, 999, 1, + options->image.max_enlargement_size, &c_options->image.max_enlargement_size); + pref_checkbox_link_sensitivity(enlargement_button, spin); hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); - ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"), + ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (% of window):"), options->image.limit_autofit_size, &c_options->image.limit_autofit_size); spin = pref_spin_new_int(hbox, NULL, NULL, 10, 150, 1,