gint limit_window_size = FALSE;
gint zoom_to_fit_expands = TRUE;
gint max_window_size = 100;
+gint limit_autofit_size = FALSE;
+gint max_autofit_size = 100;
gint thumb_max_width = 96;
gint thumb_max_height = 72;
gint enable_thumb_caching = TRUE;
extern gint limit_window_size;
extern gint zoom_to_fit_expands;
extern gint max_window_size;
+extern gint limit_autofit_size;
+extern gint max_autofit_size;
extern gint thumb_max_width;
extern gint thumb_max_height;
extern gint enable_thumb_caching;
"window_fit", (imd->top_window_sync && fit_window),
"window_limit", limit_window_size,
"window_limit_value", max_window_size,
+ "autofit_limit", limit_autofit_size,
+ "autofit_limit_value", max_autofit_size,
+
NULL);
pixbuf_renderer_set_parent((PixbufRenderer *)imd->pr, (GtkWindow *)imd->top_window);
PROP_CACHE_SIZE_TILES,
PROP_WINDOW_FIT,
PROP_WINDOW_LIMIT,
- PROP_WINDOW_LIMIT_VALUE
+ PROP_WINDOW_LIMIT_VALUE,
+ PROP_AUTOFIT_LIMIT,
+ PROP_AUTOFIT_LIMIT_VALUE
};
150,
100,
G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+ g_object_class_install_property(gobject_class,
+ PROP_AUTOFIT_LIMIT,
+ g_param_spec_boolean("autofit_limit",
+ "Limit size of image when autofitting",
+ NULL,
+ FALSE,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+ g_object_class_install_property(gobject_class,
+ PROP_AUTOFIT_LIMIT_VALUE,
+ g_param_spec_uint("autofit_limit_value",
+ "Size limit of image when autofitting",
+ NULL,
+ 10,
+ 150,
+ 100,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+
signals[SIGNAL_ZOOM] =
g_signal_new("zoom",
case PROP_WINDOW_LIMIT_VALUE:
pr->window_limit_size = g_value_get_uint(value);
break;
+ case PROP_AUTOFIT_LIMIT:
+ pr->autofit_limit = g_value_get_boolean(value);
+ break;
+ case PROP_AUTOFIT_LIMIT_VALUE:
+ pr->autofit_limit_size = g_value_get_uint(value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
case PROP_WINDOW_LIMIT_VALUE:
g_value_set_uint(value, pr->window_limit_size);
break;
+ case PROP_AUTOFIT_LIMIT:
+ g_value_set_boolean(value, pr->autofit_limit);
+ break;
+ case PROP_AUTOFIT_LIMIT_VALUE:
+ g_value_set_uint(value, pr->autofit_limit_size);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
h = h * scale + 0.5;
if (h > max_h) h = max_h;
}
+
+ if (pr->autofit_limit)
+ {
+ w = w * pr->autofit_limit_size / 100;
+ h = h * pr->autofit_limit_size / 100;
+ }
+
if (w < 1) w = 1;
if (h < 1) h = 1;
}
gboolean window_limit;
gint window_limit_size;
+ gboolean autofit_limit;
+ gint autofit_limit_size;
+
+
gint tile_cache_max; /* max mb to use for offscreen buffer */
/*< private >*/
static gint limit_window_size_c;
static gint zoom_to_fit_expands_c;
static gint max_window_size_c;
+static gint limit_autofit_size_c;
+static gint max_autofit_size_c;
static gint progressive_key_scrolling_c;
static gint thumb_max_width_c;
static gint thumb_max_height_c;
limit_window_size = limit_window_size_c;
zoom_to_fit_expands = zoom_to_fit_expands_c;
max_window_size = max_window_size_c;
+ limit_autofit_size = limit_autofit_size_c;
+ max_autofit_size = max_autofit_size_c;
progressive_key_scrolling = progressive_key_scrolling_c;
thumb_max_width = thumb_max_width_c;
thumb_max_height = thumb_max_height_c;
pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"),
zoom_to_fit_expands, &zoom_to_fit_expands_c);
+ hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
+ ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"),
+ limit_autofit_size, &limit_autofit_size_c);
+ spin = pref_spin_new_int(hbox, NULL, NULL,
+ 10, 150, 1,
+ max_autofit_size, &max_autofit_size_c);
+ pref_checkbox_link_sensitivity(ct_button, spin);
+
zoom_increment_c = zoom_increment;
spin = pref_spin_new(group, _("Zoom increment:"), NULL,
0.1, 4.0, 1.0, 1, (double)zoom_increment / 10.0,
write_bool_option(f, "fit_window_to_image", fit_window);
write_bool_option(f, "limit_window_size", limit_window_size);
write_int_option(f, "max_window_size", max_window_size);
+ write_bool_option(f, "limit_autofit_size", limit_autofit_size);
+ write_int_option(f, "max_autofit_size", max_autofit_size);
fprintf(f,"\n");
write_bool_option(f, "progressive_keyboard_scrolling", progressive_key_scrolling);
"limit_window_size", value, limit_window_size);
max_window_size = read_int_option(f, option,
"max_window_size", value, max_window_size);
+ limit_autofit_size = read_bool_option(f, option,
+ "limit_autofit_size", value, limit_autofit_size);
+ max_autofit_size = read_int_option(f, option,
+ "max_autofit_size", value, max_autofit_size);
progressive_key_scrolling = read_bool_option(f, option,
"progressive_keyboard_scrolling", value, progressive_key_scrolling);
scroll_reset_method = read_int_option(f, option,