Get rid of non-intelligent scrollbar stepper sensitivity code.

2008-07-13  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell.c (gimp_display_shell_new): Get rid
	of non-intelligent scrollbar stepper sensitivity code.

	* app/display/gimpdisplayshell-scroll.c
	(gimp_display_shell_scroll_clamp_offsets): Add intelligent
	scrollbar stepper sensitivity code.

svn path=/trunk/; revision=26178
This commit is contained in:
Martin Nordholts
2008-07-13 14:48:44 +00:00
committed by Martin Nordholts
parent 60fb7eda29
commit fe0d07de9f
3 changed files with 35 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2008-07-13 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell.c (gimp_display_shell_new): Get rid
of non-intelligent scrollbar stepper sensitivity code.
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_scroll_clamp_offsets): Add intelligent
scrollbar stepper sensitivity code.
2008-07-13 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c

View File

@ -166,6 +166,32 @@ gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell)
max_offset_y = sh + overpan_amount - shell->disp_height;
}
/* Handle scrollbar stepper sensitiity */
gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->hsb),
min_offset_x < shell->offset_x ?
GTK_SENSITIVITY_ON :
GTK_SENSITIVITY_OFF);
gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->hsb),
max_offset_x > shell->offset_x ?
GTK_SENSITIVITY_ON :
GTK_SENSITIVITY_OFF);
gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->vsb),
min_offset_y < shell->offset_y ?
GTK_SENSITIVITY_ON :
GTK_SENSITIVITY_OFF);
gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->vsb),
max_offset_y > shell->offset_y ?
GTK_SENSITIVITY_ON :
GTK_SENSITIVITY_OFF);
/* Clamp */
shell->offset_x = CLAMP (shell->offset_x, min_offset_x, max_offset_x);
shell->offset_y = CLAMP (shell->offset_y, min_offset_y, max_offset_y);
}

View File

@ -936,9 +936,6 @@ gimp_display_shell_new (GimpDisplay *display,
1, 1, image_width));
shell->hsb = gtk_hscrollbar_new (shell->hsbdata);
gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->hsb), GTK_SENSITIVITY_ON);
gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->hsb), GTK_SENSITIVITY_ON);
GTK_WIDGET_UNSET_FLAGS (shell->hsb, GTK_CAN_FOCUS);
/* the vertical scrollbar */
@ -946,9 +943,6 @@ gimp_display_shell_new (GimpDisplay *display,
1, 1, image_height));
shell->vsb = gtk_vscrollbar_new (shell->vsbdata);
gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->vsb), GTK_SENSITIVITY_ON);
gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->vsb), GTK_SENSITIVITY_ON);
GTK_WIDGET_UNSET_FLAGS (shell->vsb, GTK_CAN_FOCUS);
/* create the contents of the inner_table ********************************/