Skip to content

Commit

Permalink
Allow to change image.scroll_reset_method in Preferences > Image.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Monin committed Sep 4, 2008
1 parent baedcd2 commit aa81bf7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ static void zoom_mode_none_cb(GtkWidget *widget, gpointer data)
c_options->image.zoom_mode = ZOOM_RESET_NONE;
}

static void scroll_reset_cb(GtkWidget *widget, gpointer data)
{
if (GTK_TOGGLE_BUTTON (widget)->active)
c_options->image.scroll_reset_method = GPOINTER_TO_INT(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);
Expand Down Expand Up @@ -236,6 +242,7 @@ static void config_window_apply(void)
options->layout.tools_restore_state = c_options->layout.tools_restore_state;
options->layout.save_window_positions = c_options->layout.save_window_positions;
options->image.zoom_mode = c_options->image.zoom_mode;
options->image.scroll_reset_method = c_options->image.scroll_reset_method;
options->image.zoom_2pass = c_options->image.zoom_2pass;
options->image.fit_window_to_image = c_options->image.fit_window_to_image;
options->image.limit_window_size = c_options->image.limit_window_size;
Expand Down Expand Up @@ -1032,6 +1039,20 @@ static void config_tab_image(GtkWidget *notebook)
(options->image.zoom_mode == ZOOM_RESET_NONE),
G_CALLBACK(zoom_mode_none_cb), NULL);

group = pref_group_new(vbox, FALSE, _("Scroll reset method:"), GTK_ORIENTATION_VERTICAL);

c_options->image.scroll_reset_method = options->image.scroll_reset_method;
button = pref_radiobutton_new(group, NULL, _("Top left"),
(options->image.scroll_reset_method == SCROLL_RESET_TOPLEFT),
G_CALLBACK(scroll_reset_cb), GINT_TO_POINTER(SCROLL_RESET_TOPLEFT));
button = pref_radiobutton_new(group, button, _("Center"),
(options->image.scroll_reset_method == SCROLL_RESET_CENTER),
G_CALLBACK(scroll_reset_cb), GINT_TO_POINTER(SCROLL_RESET_CENTER));
button = pref_radiobutton_new(group, button, _("No change"),
(options->image.scroll_reset_method == SCROLL_RESET_NOCHANGE),
G_CALLBACK(scroll_reset_cb), GINT_TO_POINTER(SCROLL_RESET_NOCHANGE));


group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL);

pref_checkbox_new_int(group, _("Custom border color"),
Expand Down

0 comments on commit aa81bf7

Please sign in to comment.