Commit a01c6883 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/dialogs/image-merge-layers-dialog.c made them not resizable.

2004-10-23  Michael Natterer  <mitch@gimp.org>

	* app/dialogs/image-merge-layers-dialog.c
	* app/dialogs/layer-add-mask-dialog.c: made them not resizable.

	* app/dialogs/convert-dialog.c
	* app/dialogs/offset-dialog.c: renamed ugly variables.

	* app/dialogs/image-new-dialog.c
	* app/dialogs/stroke-dialog.c: irrelevant pedantic code reordering.
parent b408ac30
2004-10-23 Michael Natterer <mitch@gimp.org>
* app/dialogs/image-merge-layers-dialog.c
* app/dialogs/layer-add-mask-dialog.c: made them not resizable.
* app/dialogs/convert-dialog.c
* app/dialogs/offset-dialog.c: renamed ugly variables.
* app/dialogs/image-new-dialog.c
* app/dialogs/stroke-dialog.c: irrelevant pedantic code reordering.
2004-10-23 Michael Natterer <mitch@gimp.org>
 
* app/dialogs/Makefile.am
......
......@@ -46,11 +46,10 @@
typedef struct
{
GtkWidget *dialog;
GimpImage *gimage;
GimpProgress *progress;
GtkWidget *shell;
GimpContext *context;
GimpContainer *container;
GimpPalette *custom_palette;
......@@ -117,7 +116,7 @@ convert_dialog_new (GimpImage *gimage,
dialog->num_colors = saved_num_colors;
dialog->palette_type = saved_palette_type;
dialog->shell =
dialog->dialog =
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
_("Indexed Color Conversion"),
"gimp-image-convert-indexed",
......@@ -132,29 +131,30 @@ convert_dialog_new (GimpImage *gimage,
NULL);
g_signal_connect (dialog->shell, "response",
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
g_object_weak_ref (G_OBJECT (dialog->dialog),
(GWeakNotify) g_free, dialog);
g_signal_connect (dialog->dialog, "response",
G_CALLBACK (convert_dialog_response),
dialog);
g_object_weak_ref (G_OBJECT (dialog->shell),
(GWeakNotify) g_free,
dialog);
palette_box = convert_dialog_palette_box (dialog);
if (dialog->context)
g_object_weak_ref (G_OBJECT (dialog->shell),
g_object_weak_ref (G_OBJECT (dialog->dialog),
(GWeakNotify) g_object_unref,
dialog->context);
if (dialog->container)
g_object_weak_ref (G_OBJECT (dialog->shell),
g_object_weak_ref (G_OBJECT (dialog->dialog),
(GWeakNotify) g_object_unref,
dialog->container);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog->shell)->vbox),
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->vbox),
main_vbox);
gtk_widget_show (main_vbox);
......@@ -255,7 +255,7 @@ convert_dialog_new (GimpImage *gimage,
G_CALLBACK (gimp_toggle_button_update),
&dialog->alpha_dither);
return dialog->shell;
return dialog->dialog;
}
......@@ -298,7 +298,7 @@ convert_dialog_response (GtkWidget *widget,
saved_palette = dialog->custom_palette;
}
gtk_widget_destroy (dialog->shell);
gtk_widget_destroy (dialog->dialog);
}
static GtkWidget *
......
......@@ -69,6 +69,8 @@ image_merge_layers_dialog_new (GimpImage *image,
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
g_object_weak_ref (G_OBJECT (dialog->dialog),
(GWeakNotify) g_free, dialog);
......
......@@ -103,17 +103,16 @@ image_new_dialog_new (Gimp *gimp)
NULL);
g_signal_connect (dialog->dialog, "response",
G_CALLBACK (image_new_response),
dialog);
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
g_object_set_data_full (G_OBJECT (dialog->dialog),
"gimp-image-new-dialog", dialog,
(GDestroyNotify) g_free);
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
g_signal_connect (dialog->dialog, "response",
G_CALLBACK (image_new_response),
dialog);
/* vbox holding the rest of the dialog */
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog->dialog)->vbox),
......
......@@ -71,6 +71,8 @@ layer_add_mask_dialog_new (GimpLayer *layer,
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
g_object_weak_ref (G_OBJECT (dialog->dialog),
(GWeakNotify) g_free, dialog);
......
......@@ -51,7 +51,7 @@ typedef struct _OffsetDialog OffsetDialog;
struct _OffsetDialog
{
GtkWidget *dlg;
GtkWidget *dialog;
GtkWidget *off_se;
GimpOffsetType fill_type;
......@@ -64,9 +64,9 @@ struct _OffsetDialog
static void offset_response (GtkWidget *widget,
gint response_id,
OffsetDialog *off_d);
OffsetDialog *dialog);
static void offset_halfheight_callback (GtkWidget *widget,
OffsetDialog *off_d);
OffsetDialog *dialog);
/* public functions */
......@@ -75,7 +75,7 @@ GtkWidget *
offset_dialog_new (GimpDrawable *drawable,
GtkWidget *parent)
{
OffsetDialog *off_d;
OffsetDialog *dialog;
GtkWidget *main_vbox;
GtkWidget *vbox;
GtkWidget *hbox;
......@@ -89,10 +89,10 @@ offset_dialog_new (GimpDrawable *drawable,
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
off_d = g_new0 (OffsetDialog, 1);
dialog = g_new0 (OffsetDialog, 1);
off_d->fill_type = gimp_drawable_has_alpha (drawable) | WRAP_AROUND;
off_d->gimage = gimp_item_get_image (GIMP_ITEM (drawable));
dialog->fill_type = gimp_drawable_has_alpha (drawable) | WRAP_AROUND;
dialog->gimage = gimp_item_get_image (GIMP_ITEM (drawable));
if (GIMP_IS_LAYER (drawable))
title = _("Offset Layer");
......@@ -103,30 +103,33 @@ offset_dialog_new (GimpDrawable *drawable,
else
g_warning ("%s: unexpected drawable type", G_STRFUNC);
off_d->dlg = gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable),
_("Offset"), "gimp-drawable-offset",
GIMP_STOCK_TOOL_MOVE,
title,
parent,
gimp_standard_help_func,
GIMP_HELP_LAYER_OFFSET,
dialog->dialog =
gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable),
_("Offset"), "gimp-drawable-offset",
GIMP_STOCK_TOOL_MOVE,
title,
parent,
gimp_standard_help_func,
GIMP_HELP_LAYER_OFFSET,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
NULL);
gtk_window_set_resizable (GTK_WINDOW (off_d->dlg), FALSE);
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
g_object_weak_ref (G_OBJECT (off_d->dlg), (GWeakNotify) g_free, off_d);
g_object_weak_ref (G_OBJECT (dialog->dialog),
(GWeakNotify) g_free, dialog);
g_signal_connect (off_d->dlg, "response",
g_signal_connect (dialog->dialog, "response",
G_CALLBACK (offset_response),
off_d);
dialog);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (off_d->dlg)->vbox), main_vbox);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->vbox),
main_vbox);
gtk_widget_show (main_vbox);
/* The offset frame */
......@@ -147,49 +150,49 @@ offset_dialog_new (GimpDrawable *drawable,
1, 2);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
off_d->off_se = gimp_size_entry_new (1, GIMP_UNIT_PIXEL, "%a",
TRUE, TRUE, FALSE, 10,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
dialog->off_se = gimp_size_entry_new (1, GIMP_UNIT_PIXEL, "%a",
TRUE, TRUE, FALSE, 10,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gtk_table_set_col_spacing (GTK_TABLE (off_d->off_se), 0, 4);
gtk_table_set_col_spacing (GTK_TABLE (off_d->off_se), 1, 4);
gtk_table_set_row_spacing (GTK_TABLE (off_d->off_se), 0, 2);
gtk_table_set_col_spacing (GTK_TABLE (dialog->off_se), 0, 4);
gtk_table_set_col_spacing (GTK_TABLE (dialog->off_se), 1, 4);
gtk_table_set_row_spacing (GTK_TABLE (dialog->off_se), 0, 2);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (off_d->off_se),
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (dialog->off_se),
GTK_SPIN_BUTTON (spinbutton), NULL);
gtk_table_attach_defaults (GTK_TABLE (off_d->off_se), spinbutton,
gtk_table_attach_defaults (GTK_TABLE (dialog->off_se), spinbutton,
1, 2, 0, 1);
gtk_widget_show (spinbutton);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (off_d->off_se),
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (dialog->off_se),
_("_X:"), 0, 0, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (off_d->off_se),
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (dialog->off_se),
_("_Y:"), 1, 0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), off_d->off_se, FALSE, FALSE, 0);
gtk_widget_show (off_d->off_se);
gtk_box_pack_start (GTK_BOX (vbox), dialog->off_se, FALSE, FALSE, 0);
gtk_widget_show (dialog->off_se);
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (off_d->off_se), GIMP_UNIT_PIXEL);
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (dialog->off_se), GIMP_UNIT_PIXEL);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (off_d->off_se), 0,
off_d->gimage->xresolution, FALSE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (off_d->off_se), 1,
off_d->gimage->yresolution, FALSE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (dialog->off_se), 0,
dialog->gimage->xresolution, FALSE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (dialog->off_se), 1,
dialog->gimage->yresolution, FALSE);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (off_d->off_se), 0,
-off_d->gimage->width,
off_d->gimage->width);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (off_d->off_se), 1,
-off_d->gimage->height,
off_d->gimage->height);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (dialog->off_se), 0,
-dialog->gimage->width,
dialog->gimage->width);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (dialog->off_se), 1,
-dialog->gimage->height,
dialog->gimage->height);
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (off_d->off_se), 0,
0, off_d->gimage->width);
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (off_d->off_se), 1,
0, off_d->gimage->height);
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (dialog->off_se), 0,
0, dialog->gimage->width);
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (dialog->off_se), 1,
0, dialog->gimage->height);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0, 0);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1, 0);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se), 0, 0);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se), 1, 0);
button = gtk_button_new_with_mnemonic (_("Offset by x/_2, y/2"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
......@@ -197,12 +200,12 @@ offset_dialog_new (GimpDrawable *drawable,
g_signal_connect (button, "clicked",
G_CALLBACK (offset_halfheight_callback),
off_d);
dialog);
/* The edge behaviour frame */
frame = gimp_int_radio_group_new (TRUE, _("Edge Behaviour"),
G_CALLBACK (gimp_radio_button_update),
&off_d->fill_type, off_d->fill_type,
&dialog->fill_type, dialog->fill_type,
_("_Wrap around"),
WRAP_AROUND, NULL,
......@@ -220,7 +223,7 @@ offset_dialog_new (GimpDrawable *drawable,
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
return off_d->dlg;
return dialog->dialog;
}
......@@ -229,7 +232,7 @@ offset_dialog_new (GimpDrawable *drawable,
static void
offset_response (GtkWidget *widget,
gint response_id,
OffsetDialog *off_d)
OffsetDialog *dialog)
{
if (response_id == GTK_RESPONSE_OK)
{
......@@ -238,37 +241,37 @@ offset_response (GtkWidget *widget,
gint offset_x;
gint offset_y;
if ((gimage = off_d->gimage) != NULL)
if ((gimage = dialog->gimage) != NULL)
{
drawable = gimp_image_active_drawable (gimage);
offset_x =
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se),
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (dialog->off_se),
0));
offset_y =
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se),
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (dialog->off_se),
1));
gimp_drawable_offset (drawable,
gimp_get_user_context (gimage->gimp),
off_d->fill_type & WRAP_AROUND ? TRUE : FALSE,
off_d->fill_type & FILL_MASK,
dialog->fill_type & WRAP_AROUND ? TRUE : FALSE,
dialog->fill_type & FILL_MASK,
offset_x, offset_y);
gimp_image_flush (gimage);
}
}
gtk_widget_destroy (off_d->dlg);
gtk_widget_destroy (dialog->dialog);
}
static void
offset_halfheight_callback (GtkWidget *widget,
OffsetDialog *off_d)
OffsetDialog *dialog)
{
GimpImage *gimage = off_d->gimage;
GimpImage *gimage = dialog->gimage;
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (off_d->off_se),
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se),
0, gimage->width / 2);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (off_d->off_se),
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se),
1, gimage->height / 2);
}
......@@ -112,6 +112,8 @@ stroke_dialog_new (GimpItem *item,
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
g_signal_connect (dialog, "response",
G_CALLBACK (stroke_dialog_response),
dialog);
......@@ -120,8 +122,6 @@ stroke_dialog_new (GimpItem *item,
g_object_set_data_full (G_OBJECT (dialog), "gimp-stroke-desc", desc,
(GDestroyNotify) g_object_unref);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment