/** * gimp_display_shell_scale_update_scrollbars: * @shell: * **/ void gimp_display_shell_scale_update_scrollbars (GimpDisplayShell *shell) { GimpImage *image; gint image_width; gint image_height; if (! shell->display) return; image = gimp_display_get_image (shell->display); if (image) { image_width = gimp_image_get_width (image); image_height = gimp_image_get_height (image); } else { image_width = shell->disp_width; image_height = shell->disp_height; } /* Horizontal scrollbar */ g_object_freeze_notify (G_OBJECT (shell->hsbdata)); /* Update upper and lower value before we set the new value */ gimp_display_shell_scroll_setup_hscrollbar (shell, shell->offset_x); g_object_set (shell->hsbdata, "value", (gdouble) shell->offset_x, "page-size", (gdouble) shell->disp_width, "page-increment", (gdouble) shell->disp_width / 2, NULL); g_object_thaw_notify (G_OBJECT (shell->hsbdata)); /* emits "changed" */ /* Vertcal scrollbar */ g_object_freeze_notify (G_OBJECT (shell->vsbdata)); /* Update upper and lower value before we set the new value */ gimp_display_shell_scroll_setup_vscrollbar (shell, shell->offset_y); g_object_set (shell->vsbdata, "value", (gdouble) shell->offset_y, "page-size", (gdouble) shell->disp_height, "page-increment", (gdouble) shell->disp_height / 2, NULL); g_object_thaw_notify (G_OBJECT (shell->vsbdata)); /* emits "changed" */ }
static gboolean gimp_display_shell_hscrollbar_change_value (GtkRange *range, GtkScrollType scroll, gdouble value, GimpDisplayShell *shell) { if (! shell->display) return TRUE; if ((scroll == GTK_SCROLL_JUMP) || (scroll == GTK_SCROLL_PAGE_BACKWARD) || (scroll == GTK_SCROLL_PAGE_FORWARD)) return FALSE; g_object_freeze_notify (G_OBJECT (shell->hsbdata)); gimp_display_shell_scroll_setup_hscrollbar (shell, value); g_object_thaw_notify (G_OBJECT (shell->hsbdata)); /* emits "changed" */ return FALSE; }