mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
app/actions/image-commands.c app/actions/layers-commands.c
2005-08-24 Sven Neumann <sven@gimp.org> * app/actions/image-commands.c * app/actions/layers-commands.c * app/dialogs/image-scale-dialog.c * app/dialogs/resize-dialog.[ch]: remember the selected unit for scale and resize dialogs on a per-image basis (bug #312950).
This commit is contained in:
parent
dff3e7584e
commit
ad5287c3ba
5 changed files with 57 additions and 14 deletions
|
@ -78,6 +78,7 @@ static void image_resize_callback (GtkWidget *dialog,
|
|||
GimpViewable *viewable,
|
||||
gint width,
|
||||
gint height,
|
||||
GimpUnit unit,
|
||||
gint offset_x,
|
||||
gint offset_y,
|
||||
GimpImageResizeLayers resize_layers,
|
||||
|
@ -177,11 +178,12 @@ image_resize_cmd_callback (GtkAction *action,
|
|||
gpointer data)
|
||||
{
|
||||
ImageResizeOptions *options;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GimpDisplay *gdisp;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpUnit unit;
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
return_if_no_display (gdisp, data);
|
||||
|
||||
|
@ -190,11 +192,16 @@ image_resize_cmd_callback (GtkAction *action,
|
|||
options->gdisp = gdisp;
|
||||
options->context = action_data_get_context (data);
|
||||
|
||||
dialog = resize_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
unit = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (image),
|
||||
"scale-dialog-unit"));
|
||||
if (! unit)
|
||||
unit = GIMP_DISPLAY_SHELL (gdisp->shell)->unit;
|
||||
|
||||
dialog = resize_dialog_new (GIMP_VIEWABLE (image),
|
||||
_("Set Image Canvas Size"), "gimp-image-resize",
|
||||
widget,
|
||||
gimp_standard_help_func, GIMP_HELP_IMAGE_RESIZE,
|
||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||
unit,
|
||||
image_resize_callback,
|
||||
options);
|
||||
|
||||
|
@ -452,6 +459,7 @@ image_resize_callback (GtkWidget *dialog,
|
|||
GimpViewable *viewable,
|
||||
gint width,
|
||||
gint height,
|
||||
GimpUnit unit,
|
||||
gint offset_x,
|
||||
gint offset_y,
|
||||
GimpImageResizeLayers resize_layers,
|
||||
|
@ -468,6 +476,10 @@ image_resize_callback (GtkWidget *dialog,
|
|||
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
/* remember the last used unit */
|
||||
g_object_set_data (G_OBJECT (image),
|
||||
"scale-dialog-unit", GINT_TO_POINTER (unit));
|
||||
|
||||
if (width == image->width && height == image->height)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue